Java java.util.concurrent.atomic AtomicLong fields, constructors, methods, implement or subclass

Example usage for Java java.util.concurrent.atomic AtomicLong fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.util.concurrent.atomic AtomicLong.

The text is from its open source code.

Constructor

AtomicLong(long initialValue)
Creates a new AtomicLong with the given initial value.
AtomicLong()
Creates a new AtomicLong with initial value 0 .

Method

longaccumulateAndGet(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.
longaddAndGet(long delta)
Atomically adds the given value to the current value, with memory effects as specified by VarHandle#getAndAdd .
booleancompareAndSet(long expectedValue, long newValue)
Atomically sets the value to newValue if the current value == expectedValue , with memory effects as specified by VarHandle#compareAndSet .
longdecrementAndGet()
Atomically decrements the current value, with memory effects as specified by VarHandle#getAndAdd .
doubledoubleValue()
Returns the current value of this AtomicLong as a double after a widening primitive conversion, with memory effects as specified by VarHandle#getVolatile .
floatfloatValue()
Returns the current value of this AtomicLong as a float after a widening primitive conversion, with memory effects as specified by VarHandle#getVolatile .
longget()
Returns the current value, with memory effects as specified by VarHandle#getVolatile .
longgetAndAdd(long delta)
Atomically adds the given value to the current value, with memory effects as specified by VarHandle#getAndAdd .
longgetAndDecrement()
Atomically decrements the current value, with memory effects as specified by VarHandle#getAndAdd .
longgetAndIncrement()
Atomically increments the current value, with memory effects as specified by VarHandle#getAndAdd .
longgetAndSet(long newValue)
Atomically sets the value to newValue and returns the old value, with memory effects as specified by VarHandle#getAndSet .
longincrementAndGet()
Atomically increments the current value, with memory effects as specified by VarHandle#getAndAdd .
intintValue()
Returns the current value of this AtomicLong as an int after a narrowing primitive conversion, with memory effects as specified by VarHandle#getVolatile .
voidlazySet(long newValue)
Sets the value to newValue , with memory effects as specified by VarHandle#setRelease .
longlongValue()
Returns the current value of this AtomicLong as a long , with memory effects as specified by VarHandle#getVolatile .
voidset(long newValue)
Sets the value to newValue , with memory effects as specified by VarHandle#setVolatile .
StringtoString()
Returns the String representation of the current value.
longupdateAndGet(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.
booleanweakCompareAndSet(long expectedValue, long newValue)
Possibly atomically sets the value to newValue if the current value == expectedValue , with memory effects as specified by VarHandle#weakCompareAndSetPlain .