-
Nested Class Summary
Nested Classes
static final class
static final class
-
Method Summary
int
Gets the value after what it gets updated using the specified function and update value.
int
Adds the delta to the value after what it is returned.
Creates new simple int wrapper with initial value set to 0.
Creates new simple int wrapper.
Creates new atomic int wrapper with initial value set to 0.
Creates new atomic int wrapper.
int
Decrements the value after what it is returned.
int
int
Updates the current value using specified function and update value after what the new value is returned.
int
Gets the value after what delta is added to it.
int
Gets the value after what it gets decremented.
int
Gets the value after what it gets incremented.
int
Sets the value to the one given returning the previous one.
int
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.
int
Increments the value after what it is returned.
void
int
Gets the value after what it gets updated using the specified function.
-
Method Details
-
create
Creates new simple int wrapper.
- Parameters:
value - initial value of int wrapper
- Returns:
- created int wrapper
-
create
Creates new simple int wrapper with initial value set to 0.
- Returns:
- created int wrapper
-
createAtomic
Creates new atomic int wrapper.
- Parameters:
value - initial value of int wrapper
- Returns:
- created int wrapper
-
createAtomic
Creates new atomic int wrapper with initial value set to 0.
- Returns:
- created int wrapper
-
-
-
get
int get()
Gets the value.
- Returns:
- value
-
set
void set(int value)
Sets the value.
- Parameters:
value - value to be set
-
getAndSet
int getAndSet(int newValue)
Sets the value to the one given returning the previous one.
- Parameters:
newValue - value to be set
- Returns:
- previous value
-
getAndIncrement
int getAndIncrement()
Gets the value after what it gets incremented.
- Returns:
- value before increment
-
incrementAndGet
int incrementAndGet()
Increments the value after what it is returned.
- Returns:
- value after increment
-
getAndDecrement
int getAndDecrement()
Gets the value after what it gets decremented.
- Returns:
- value before decrement
-
decrementAndGet
int decrementAndGet()
Decrements the value after what it is returned.
- Returns:
- value after decrement
-
getAndAdd
int getAndAdd(int 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
int addAndGet(int 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
int getAndAccumulate(int updateValue,
@NonNull
@NonNull IntBinaryOperator 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
int accumulateAndGet(int updateValue,
@NonNull
@NonNull IntBinaryOperator 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