Example usage for Java java.util.concurrent.atomic AtomicLong fields, constructors, methods, implement or subclass
The text is from its open source code.
AtomicLong(long initialValue) Creates a new AtomicLong with the given initial value. | |
AtomicLong() Creates a new AtomicLong with initial value 0 . |
long | accumulateAndGet(long x, LongBinaryOperator accumulatorFunction) Atomically updates (with memory effects as specified by VarHandle#compareAndSet ) the current value with the results of applying the given function to the current and given values, returning the updated value. |
long | addAndGet(long delta) Atomically adds the given value to the current value, with memory effects as specified by VarHandle#getAndAdd . |
boolean | compareAndSet(long expectedValue, long newValue) Atomically sets the value to newValue if the current value == expectedValue , with memory effects as specified by VarHandle#compareAndSet . |
long | decrementAndGet() Atomically decrements the current value, with memory effects as specified by VarHandle#getAndAdd . |
double | doubleValue() Returns the current value of this AtomicLong as a double after a widening primitive conversion, with memory effects as specified by VarHandle#getVolatile . |
float | floatValue() Returns the current value of this AtomicLong as a float after a widening primitive conversion, with memory effects as specified by VarHandle#getVolatile . |
long | get() Returns the current value, with memory effects as specified by VarHandle#getVolatile . |
long | getAndAdd(long delta) Atomically adds the given value to the current value, with memory effects as specified by VarHandle#getAndAdd . |
long | getAndDecrement() Atomically decrements the current value, with memory effects as specified by VarHandle#getAndAdd . |
long | getAndIncrement() Atomically increments the current value, with memory effects as specified by VarHandle#getAndAdd . |
long | getAndSet(long newValue) Atomically sets the value to newValue and returns the old value, with memory effects as specified by VarHandle#getAndSet . |
long | incrementAndGet() Atomically increments the current value, with memory effects as specified by VarHandle#getAndAdd . |
int | intValue() Returns the current value of this AtomicLong as an int after a narrowing primitive conversion, with memory effects as specified by VarHandle#getVolatile . |
void | lazySet(long newValue) Sets the value to newValue , with memory effects as specified by VarHandle#setRelease . |
long | longValue() Returns the current value of this AtomicLong as a long , with memory effects as specified by VarHandle#getVolatile . |
void | set(long newValue) Sets the value to newValue , with memory effects as specified by VarHandle#setVolatile . |
String | toString() Returns the String representation of the current value. |
long | updateAndGet(LongUnaryOperator updateFunction) Atomically updates (with memory effects as specified by VarHandle#compareAndSet ) the current value with the results of applying the given function, returning the updated value. |
boolean | weakCompareAndSet(long expectedValue, long newValue) Possibly atomically sets the value to newValue if the current value == expectedValue , with memory effects as specified by VarHandle#weakCompareAndSetPlain . |