public interface FloatValue
Implementations may store the value in different formats or mediums. For example, the value could be stored in binary format or text format, in memory or on disk.
The getValue and getVolatileValue methods retrieve the current float value. The difference between these methods is that getVolatileValue uses volatile semantics, meaning it includes a memory barrier which ensures that subsequent reads and writes are not reordered beyond this point.
The setValue and setOrderedValue methods set the float value. The difference between these methods is that setOrderedValue uses ordered semantics, meaning it includes a memory barrier which ensures that previous writes are not reordered beyond this point.
The addValue and addAtomicValue methods add a specified float to the current value and return the result. The difference between these methods is that addAtomicValue uses atomic semantics, meaning the operation is done atomically and is visible to all threads.
BooleanValue,
ByteValue,
CharValue,
DoubleValue,
FloatValue,
IntValue,
LongValue,
ShortValue,
StringValue,
LongArrayValues,
IntArrayValues| Modifier and Type | Method and Description |
|---|---|
float |
addAtomicValue(float delta)
Adds a specified float to the current value and returns the result using atomic semantics.
|
float |
addValue(float delta)
Adds a specified float to the current value and returns the result.
|
float |
getValue()
Retrieves the float value.
|
float |
getVolatileValue()
Retrieves the float value using volatile semantics.
|
void |
setOrderedValue(float value)
Sets the float value using ordered semantics.
|
void |
setValue(float value)
Sets the float value.
|
float getValue()
void setValue(float value)
value - the float value to setvoid setOrderedValue(float value)
value - the float value to setfloat getVolatileValue()
float addValue(float delta)
delta - the float to add to the current valuefloat addAtomicValue(float delta)
delta - the float to add to the current valueCopyright © 2024. All rights reserved.