double array in which elements may be updated atomically. See the java.util.concurrent.atomic package specification for description of the properties of atomic
variables.
This class compares primitive double values in methods such as
compareAndSet by comparing their bitwise representation using Double#doubleToRawLongBits, which differs from both the primitive double == operator and
from Double#equals, as if implemented by:
static boolean bitEquals(double x, double y) {
long xBits = Double.doubleToRawLongBits(x);
long yBits = Double.doubleToRawLongBits(y);
return xBits == yBits;
}
| Modifier and Type | Field and Description |
|---|---|
| private transient AtomicLongArray | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | AtomicDoubleArray(int
the length of the array length)Creates a new |
| public | AtomicDoubleArray(double[]
the array to copy elements from array)Creates a new |
| Modifier and Type | Method and Description |
|---|---|
| public final double | Returns: the updated valuethe index to update i, double the update value x, DoubleBinaryOperator the accumulator function accumulatorFunction)Atomically updates the element at index |
| public double | Returns: the updated valuethe index i, double the value to add delta)Atomically adds the given value to the element at index |
| public final boolean | Returns: true if successful. False return indicates that the actual value was not equal to the expected value.the index i, double the expected value expect, double the new value update)Atomically sets the element at position |
| public final double | |
| public final double | Returns: the previous valuethe index to update i, double the update value x, DoubleBinaryOperator the accumulator function accumulatorFunction)Atomically updates the element at index |
| public final double | Returns: the previous valuethe index i, double the value to add delta)Atomically adds the given value to the element at index |
| public final double | Returns: the previous valuethe index i, double the new value newValue)Atomically sets the element at position |
| public final double | Returns: the previous valuethe index to update i, DoubleUnaryOperator the update function updaterFunction)Atomically updates the element at index |
| public final void | lazySet(int
the index i, double the new value newValue)Eventually sets the element at position |
| public final int | |
| private void | |
| public final void | set(int
the index i, double the new value newValue)Atomically sets the element at position |
| public String | Returns: the String representation of the current values of arrayOverrides java. |
| public final double | Returns: the updated valuethe index to update i, DoubleUnaryOperator the update function updaterFunction)Atomically updates the element at index |
| public final boolean | Returns: true if successfulthe index i, double the expected value expect, double the new value update)Atomically sets the element at position |
| private void |
| longs | back to summary |
|---|---|
| private transient AtomicLongArray longs | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| AtomicDoubleArray | back to summary |
|---|---|
| public AtomicDoubleArray(int length) Creates a new
| |
| AtomicDoubleArray | back to summary |
|---|---|
| public AtomicDoubleArray(double[] array) Creates a new
| |
| accumulateAndGet | back to summary |
|---|---|
| public final double accumulateAndGet(int i, double x, DoubleBinaryOperator accumulatorFunction) Atomically updates the element at index
| |
| addAndGet | back to summary |
|---|---|
| public double addAndGet(int i, double delta) Atomically adds the given value to the element at index
| |
| compareAndSet | back to summary |
|---|---|
| public final boolean compareAndSet(int i, double expect, double update) Atomically sets the element at position
| |
| get | back to summary |
|---|---|
| public final double get(int i) Gets the current value at position
| |
| getAndAccumulate | back to summary |
|---|---|
| public final double getAndAccumulate(int i, double x, DoubleBinaryOperator accumulatorFunction) Atomically updates the element at index
| |
| getAndAdd | back to summary |
|---|---|
| public final double getAndAdd(int i, double delta) Atomically adds the given value to the element at index
| |
| getAndSet | back to summary |
|---|---|
| public final double getAndSet(int i, double newValue) Atomically sets the element at position
| |
| getAndUpdate | back to summary |
|---|---|
| public final double getAndUpdate(int i, DoubleUnaryOperator updaterFunction) Atomically updates the element at index
| |
| lazySet | back to summary |
|---|---|
| public final void lazySet(int i, double newValue) Eventually sets the element at position
| |
| length | back to summary |
|---|---|
| public final int length() Returns the length of the array.
| |
| readObject | back to summary |
|---|---|
| private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException Reconstitutes the instance from a stream (that is, deserializes it). | |
| set | back to summary |
|---|---|
| public final void set(int i, double newValue) Atomically sets the element at position
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns the String representation of the current values of array. | |
| updateAndGet | back to summary |
|---|---|
| public final double updateAndGet(int i, DoubleUnaryOperator updaterFunction) Atomically updates the element at index
| |
| weakCompareAndSet | back to summary |
|---|---|
| public final boolean weakCompareAndSet(int i, double expect, double update) Atomically sets the element at position May
fail spuriously and does not provide ordering guarantees, so is only rarely an appropriate
alternative to
| |
| writeObject | back to summary |
|---|---|
| private void writeObject(ObjectOutputStream s) throws IOException Saves the state to a stream (that is, serializes it).
| |