-
Nested Class Summary
Nested Classes
static final class
static final class
-
Method Summary
long
Gets the value after what it gets updated using the specified function and update value.
long
Adds the delta to the value after what it is returned.
Creates new simple long wrapper with initial value set to 0.
Creates new simple long wrapper.
Creates new atomic long wrapper with initial value set to 0.
Creates new atomic long wrapper.
long
Decrements the value after what it is returned.
long
long
Updates the current value using specified function and update value after what the new value is returned.
long
Gets the value after what delta is added to it.
long
Gets the value after what it gets decremented.
long
Gets the value after what it gets incremented.
long
Sets the value to the one given returning the previous one.
long
Updates the current value using the specified function after what the new value is returned.
Returns the primitive class wrapped by this one.
Returns the
java.lang primitive wrapper class corresponding to the one wrapped.
long
Increments the value after what it is returned.
void
long
Gets the value after what it gets updated using the specified function.
-
Method Details
-
create
Creates new simple long wrapper.
- Parameters:
value - initial value of long wrapper
- Returns:
- created long wrapper
-
create
Creates new simple long wrapper with initial value set to 0.
- Returns:
- created long wrapper
-
createAtomic
Creates new atomic long wrapper.
- Parameters:
value - initial value of long wrapper
- Returns:
- created long wrapper
-
createAtomic
Creates new atomic long wrapper with initial value set to 0.
- Returns:
- created long wrapper
-
-
-
get
long get()
Gets the value.
- Returns:
- value
-
set
void set(long value)
Sets the value.
- Parameters:
value - value to be set
-
getAndSet
long getAndSet(long newValue)
Sets the value to the one given returning the previous one.
- Parameters:
newValue - value to be set
- Returns:
- previous value
-
getAndIncrement
long getAndIncrement()
Gets the value after what it gets incremented.
- Returns:
- value before increment
-
incrementAndGet
long incrementAndGet()
Increments the value after what it is returned.
- Returns:
- value after increment
-
getAndDecrement
long getAndDecrement()
Gets the value after what it gets decremented.
- Returns:
- value before decrement
-
decrementAndGet
long decrementAndGet()
Decrements the value after what it is returned.
- Returns:
- value after decrement
-
getAndAdd
long getAndAdd(long delta)
Gets the value after what delta is added to it.
- Parameters:
delta - the value which should be added to the current value
- Returns:
- value before addition
-
addAndGet
long addAndGet(long delta)
Adds the delta to the value after what it is returned.
- Parameters:
delta - the value which should be added to the current value
- Returns:
- value after addition
-
getAndUpdate
Updates the current value using the specified function after what the new value is returned.
- Parameters:
updateFunction - function to be used for updating the value
- Returns:
- value before update
-
updateAndGet
Gets the value after what it gets updated using the specified function.
- Parameters:
updateFunction - function to be used for updating the value
- Returns:
- value after update
-
getAndAccumulate
long getAndAccumulate(long updateValue,
@NonNull
@NonNull LongBinaryOperator accumulatorFunction)
Updates the current value using specified function and update value after what the new value is returned.
- Parameters:
updateValue - update value (will be passed as the second function parameter)
accumulatorFunction - function to be used for updating the value
- Returns:
- value before update
-
accumulateAndGet
long accumulateAndGet(long updateValue,
@NonNull
@NonNull LongBinaryOperator accumulatorFunction)
Gets the value after what it gets updated using the specified function and update value.
- Parameters:
updateValue - update value (will be passed as the second function parameter)
accumulatorFunction - function to be used for updating the value
- Returns:
- value after update