public interface DoubleValue
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 double 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 double 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 double 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
,
UnsetLongValue
Modifier and Type | Method and Description |
---|---|
double |
addAtomicValue(double delta)
Adds a specified double to the current value and returns the result using atomic semantics.
|
double |
addValue(double delta)
Adds a specified double to the current value and returns the result.
|
double |
getValue()
Retrieves the double value.
|
double |
getVolatileValue()
Retrieves the double value using volatile semantics.
|
void |
setOrderedValue(double value)
Sets the double value using ordered semantics.
|
void |
setValue(double value)
Sets the double value.
|
double getValue()
void setValue(double value)
value
- the double value to setdouble getVolatileValue()
void setOrderedValue(double value)
value
- the double value to setdouble addValue(double delta)
delta
- the double to add to the current valuedouble addAtomicValue(double delta)
delta
- the double to add to the current valueCopyright © 2023. All rights reserved.