Class IntWrapper.AtomicIntWrapper
java.lang.Object
ru.progrm_jarvis.javacommons.primitive.wrapper.IntWrapper.AtomicIntWrapper
- All Implemented Interfaces:
Numeric,IntWrapper,PrimitiveWrapper<Integer>
- Enclosing interface:
- IntWrapper
IntWrapper implementation based on AtomicInteger.-
Nested Class Summary
Nested classes/interfaces inherited from interface ru.progrm_jarvis.javacommons.primitive.wrapper.IntWrapper
IntWrapper.AtomicIntWrapper, IntWrapper.PrimitiveIntWrapper -
Method Summary
Modifier and TypeMethodDescriptionintaccumulateAndGet(int updateValue, IntBinaryOperator accumulatorFunction) Gets the value after what it gets updated using the specified function and update value.intaddAndGet(int delta) Adds the delta to the value after what it is returned.byteReturns the value asbyte.intDecrements the value after what it is returned.doubleReturns the value asdouble.booleanfloatReturns the value asfloat.intget()Gets the value.intgetAndAccumulate(int updateValue, IntBinaryOperator accumulatorFunction) Updates the current value using specified function and update value after what the new value is returned.intgetAndAdd(int delta) Gets the value after what delta is added to it.intGets the value after what it gets decremented.intGets the value after what it gets incremented.intgetAndSet(int newValue) Sets the value to the one given returning the previous one.intgetAndUpdate(IntUnaryOperator updateFunction) Updates the current value using the specified function after what the new value is returned.inthashCode()intIncrements the value after what it is returned.intintValue()Returns the value asint.longReturns the value aslong.voidset(int value) Sets the value.shortReturns the value asshort.toString()intupdateAndGet(IntUnaryOperator updateFunction) Gets the value after what it gets updated using the specified function.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface ru.progrm_jarvis.javacommons.primitive.wrapper.IntWrapper
getPrimitiveClass, getWrapperClass
-
Method Details
-
toString
-
equals
-
hashCode
public int hashCode() -
get
public int get()Description copied from interface:IntWrapperGets the value.- Specified by:
getin interfaceIntWrapper- Returns:
- value
-
set
public void set(int value) Description copied from interface:IntWrapperSets the value.- Specified by:
setin interfaceIntWrapper- Parameters:
value- value to be set
-
getAndSet
public int getAndSet(int newValue) Description copied from interface:IntWrapperSets the value to the one given returning the previous one.- Specified by:
getAndSetin interfaceIntWrapper- Parameters:
newValue- value to be set- Returns:
- previous value
-
getAndIncrement
public int getAndIncrement()Description copied from interface:IntWrapperGets the value after what it gets incremented.- Specified by:
getAndIncrementin interfaceIntWrapper- Returns:
- value before increment
-
incrementAndGet
public int incrementAndGet()Description copied from interface:IntWrapperIncrements the value after what it is returned.- Specified by:
incrementAndGetin interfaceIntWrapper- Returns:
- value after increment
-
getAndDecrement
public int getAndDecrement()Description copied from interface:IntWrapperGets the value after what it gets decremented.- Specified by:
getAndDecrementin interfaceIntWrapper- Returns:
- value before decrement
-
decrementAndGet
public int decrementAndGet()Description copied from interface:IntWrapperDecrements the value after what it is returned.- Specified by:
decrementAndGetin interfaceIntWrapper- Returns:
- value after decrement
-
getAndAdd
public int getAndAdd(int delta) Description copied from interface:IntWrapperGets the value after what delta is added to it.- Specified by:
getAndAddin interfaceIntWrapper- Parameters:
delta- the value which should be added to the current value- Returns:
- value before addition
-
addAndGet
public int addAndGet(int delta) Description copied from interface:IntWrapperAdds the delta to the value after what it is returned.- Specified by:
addAndGetin interfaceIntWrapper- Parameters:
delta- the value which should be added to the current value- Returns:
- value after addition
-
getAndUpdate
Description copied from interface:IntWrapperUpdates the current value using the specified function after what the new value is returned.- Specified by:
getAndUpdatein interfaceIntWrapper- Parameters:
updateFunction- function to be used for updating the value- Returns:
- value before update
-
updateAndGet
Description copied from interface:IntWrapperGets the value after what it gets updated using the specified function.- Specified by:
updateAndGetin interfaceIntWrapper- Parameters:
updateFunction- function to be used for updating the value- Returns:
- value after update
-
getAndAccumulate
Description copied from interface:IntWrapperUpdates the current value using specified function and update value after what the new value is returned.- Specified by:
getAndAccumulatein interfaceIntWrapper- 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
Description copied from interface:IntWrapperGets the value after what it gets updated using the specified function and update value.- Specified by:
accumulateAndGetin interfaceIntWrapper- 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
-
byteValue
public byte byteValue()Description copied from interface:NumericReturns the value asbyte. -
shortValue
public short shortValue()Description copied from interface:NumericReturns the value asshort.- Specified by:
shortValuein interfaceNumeric- Returns:
- value as
short
-
intValue
public int intValue()Description copied from interface:NumericReturns the value asint. -
longValue
public long longValue()Description copied from interface:NumericReturns the value aslong. -
floatValue
public float floatValue()Description copied from interface:NumericReturns the value asfloat.- Specified by:
floatValuein interfaceNumeric- Returns:
- value as
float
-
doubleValue
public double doubleValue()Description copied from interface:NumericReturns the value asdouble.- Specified by:
doubleValuein interfaceNumeric- Returns:
- value as
double
-