Example usage for Java java.util.concurrent.atomic AtomicInteger fields, constructors, methods, implement or subclass
The text is from its open source code.
AtomicInteger() Creates a new AtomicInteger with initial value 0 . | |
AtomicInteger(int initialValue) Creates a new AtomicInteger with the given initial value. |
int | addAndGet(int delta) Atomically adds the given value to the current value, with memory effects as specified by VarHandle#getAndAdd . |
boolean | compareAndSet(int expectedValue, int newValue) Atomically sets the value to newValue if the current value == expectedValue , with memory effects as specified by VarHandle#compareAndSet . |
int | decrementAndGet() Atomically decrements the current value, with memory effects as specified by VarHandle#getAndAdd . |
double | doubleValue() Returns the current value of this AtomicInteger as a double after a widening primitive conversion, with memory effects as specified by VarHandle#getVolatile . |
float | floatValue() Returns the current value of this AtomicInteger as a float after a widening primitive conversion, with memory effects as specified by VarHandle#getVolatile . |
int | get() Returns the current value, with memory effects as specified by VarHandle#getVolatile . |
int | getAndAdd(int delta) Atomically adds the given value to the current value, with memory effects as specified by VarHandle#getAndAdd . |
int | getAndDecrement() Atomically decrements the current value, with memory effects as specified by VarHandle#getAndAdd . |
int | getAndIncrement() Atomically increments the current value, with memory effects as specified by VarHandle#getAndAdd . |
int | getAndSet(int newValue) Atomically sets the value to newValue and returns the old value, with memory effects as specified by VarHandle#getAndSet . |
int | incrementAndGet() Atomically increments the current value, with memory effects as specified by VarHandle#getAndAdd . |
int | intValue() Returns the current value of this AtomicInteger as an int , with memory effects as specified by VarHandle#getVolatile . |
void | lazySet(int newValue) Sets the value to newValue , with memory effects as specified by VarHandle#setRelease . |
long | longValue() Returns the current value of this AtomicInteger as a long after a widening primitive conversion, with memory effects as specified by VarHandle#getVolatile . |
void | notifyAll() Wakes up all threads that are waiting on this object's monitor. |
void | set(int newValue) Sets the value to newValue , with memory effects as specified by VarHandle#setVolatile . |
String | toString() Returns the String representation of the current value. |
void | wait(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed. |
void | wait() Causes the current thread to wait until it is awakened, typically by being notified or interrupted. |
boolean | weakCompareAndSet(int expectedValue, int newValue) Possibly atomically sets the value to newValue if the current value == expectedValue , with memory effects as specified by VarHandle#weakCompareAndSetPlain . |