Class LongWrapper.AtomicLongWrapper
java.lang.Object
ru.progrm_jarvis.javacommons.primitive.wrapper.LongWrapper.AtomicLongWrapper
- All Implemented Interfaces:
Numeric,LongWrapper,PrimitiveWrapper<Long>
- Enclosing interface:
- LongWrapper
LongWrapper implementation based on AtomicLong.-
Nested Class Summary
Nested classes/interfaces inherited from interface ru.progrm_jarvis.javacommons.primitive.wrapper.LongWrapper
LongWrapper.AtomicLongWrapper, LongWrapper.PrimitiveLongWrapper -
Method Summary
Modifier and TypeMethodDescriptionlongaccumulateAndGet(long updateValue, LongBinaryOperator accumulatorFunction) Gets the value after what it gets updated using the specified function and update value.longaddAndGet(long delta) Adds the delta to the value after what it is returned.byteReturns the value asbyte.longDecrements the value after what it is returned.doubleReturns the value asdouble.booleanfloatReturns the value asfloat.longget()Gets the value.longgetAndAccumulate(long updateValue, LongBinaryOperator accumulatorFunction) Updates the current value using specified function and update value after what the new value is returned.longgetAndAdd(long delta) Gets the value after what delta is added to it.longGets the value after what it gets decremented.longGets the value after what it gets incremented.longgetAndSet(long newValue) Sets the value to the one given returning the previous one.longgetAndUpdate(LongUnaryOperator updateFunction) Updates the current value using the specified function after what the new value is returned.inthashCode()longIncrements the value after what it is returned.intintValue()Returns the value asint.longReturns the value aslong.voidset(long value) Sets the value.shortReturns the value asshort.toString()longupdateAndGet(LongUnaryOperator 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.LongWrapper
getPrimitiveClass, getWrapperClass
-
Method Details
-
toString
-
equals
-
hashCode
public int hashCode() -
get
public long get()Description copied from interface:LongWrapperGets the value.- Specified by:
getin interfaceLongWrapper- Returns:
- value
-
set
public void set(long value) Description copied from interface:LongWrapperSets the value.- Specified by:
setin interfaceLongWrapper- Parameters:
value- value to be set
-
getAndSet
public long getAndSet(long newValue) Description copied from interface:LongWrapperSets the value to the one given returning the previous one.- Specified by:
getAndSetin interfaceLongWrapper- Parameters:
newValue- value to be set- Returns:
- previous value
-
getAndIncrement
public long getAndIncrement()Description copied from interface:LongWrapperGets the value after what it gets incremented.- Specified by:
getAndIncrementin interfaceLongWrapper- Returns:
- value before increment
-
incrementAndGet
public long incrementAndGet()Description copied from interface:LongWrapperIncrements the value after what it is returned.- Specified by:
incrementAndGetin interfaceLongWrapper- Returns:
- value after increment
-
getAndDecrement
public long getAndDecrement()Description copied from interface:LongWrapperGets the value after what it gets decremented.- Specified by:
getAndDecrementin interfaceLongWrapper- Returns:
- value before decrement
-
decrementAndGet
public long decrementAndGet()Description copied from interface:LongWrapperDecrements the value after what it is returned.- Specified by:
decrementAndGetin interfaceLongWrapper- Returns:
- value after decrement
-
getAndAdd
public long getAndAdd(long delta) Description copied from interface:LongWrapperGets the value after what delta is added to it.- Specified by:
getAndAddin interfaceLongWrapper- Parameters:
delta- the value which should be added to the current value- Returns:
- value before addition
-
addAndGet
public long addAndGet(long delta) Description copied from interface:LongWrapperAdds the delta to the value after what it is returned.- Specified by:
addAndGetin interfaceLongWrapper- Parameters:
delta- the value which should be added to the current value- Returns:
- value after addition
-
getAndUpdate
Description copied from interface:LongWrapperUpdates the current value using the specified function after what the new value is returned.- Specified by:
getAndUpdatein interfaceLongWrapper- Parameters:
updateFunction- function to be used for updating the value- Returns:
- value before update
-
updateAndGet
Description copied from interface:LongWrapperGets the value after what it gets updated using the specified function.- Specified by:
updateAndGetin interfaceLongWrapper- Parameters:
updateFunction- function to be used for updating the value- Returns:
- value after update
-
getAndAccumulate
Description copied from interface:LongWrapperUpdates the current value using specified function and update value after what the new value is returned.- Specified by:
getAndAccumulatein interfaceLongWrapper- 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:LongWrapperGets the value after what it gets updated using the specified function and update value.- Specified by:
accumulateAndGetin interfaceLongWrapper- 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
-