public class PaddedAtomicLong extends PaddedAtomicLongL2Pad
AtomicLong
.b000, b001, b002, b003, b004, b005, b006, b007, b010, b011, b012, b013, b014, b015, b016, b017, b020, b021, b022, b023, b024, b025, b026, b027, b030, b031, b032, b033, b034, b035, b036, b037, b040, b041, b042, b043, b044, b045, b046, b047, b050, b051, b052, b053, b054, b055, b056, b057, b060, b061, b062, b063, b064, b065, b066, b067, b070, b071, b072, b073, b074, b075, b076, b077, b100, b101, b102, b103, b104, b105, b106, b107, b110, b111, b112, b113, b114, b115, b116, b117, b120, b121, b122, b123, b124, b125, b126, b127, b130, b131, b132, b133, b134, b135, b136, b137, b140, b141, b142, b143, b144, b145, b146, b147, b150, b151, b152, b153, b154, b155, b156, b157, b160, b161, b162, b163, b164, b165, b166, b167, b170, b171, b172, b173, b174, b175, b176, b177
Constructor and Description |
---|
PaddedAtomicLong()
Creates a new PaddedAtomicLong with initial value
0 . |
PaddedAtomicLong(long initialValue)
Creates a new PaddedAtomicLong with the given initial value.
|
Modifier and Type | Method and Description |
---|---|
long |
accumulateAndGet(long x,
java.util.function.LongBinaryOperator f)
AtomicLong.accumulateAndGet(long, LongBinaryOperator) |
long |
addAndGet(long delta)
Atomically adds to current value te given value.
|
boolean |
compareAndSet(long expect,
long update)
Atomically sets the value to the given updated value
if the current value
== the expected value. |
long |
decrementAndGet()
Atomically decrements the current value by one.
|
double |
doubleValue()
Returns the value of a
double . |
float |
floatValue()
Returns the value of a
float . |
long |
get()
Gets the current value.
|
long |
getAndAccumulate(long v,
java.util.function.LongBinaryOperator f)
Atomically updates the current value with the results of
applying the given function to the current and given values,
returning the previous value.
|
long |
getAndAdd(long delta)
Atomically adds to the current value the given value.
|
long |
getAndDecrement()
Atomically decrements the current value by 1.
|
long |
getAndIncrement()
Atomically increments the current value by 1.
|
long |
getAndSet(long newValue)
Atomically sets to the given value and returns the old value.
|
long |
getAndUpdate(java.util.function.LongUnaryOperator updateFunction)
Atomically updates the current value with the results of
applying the given function, returning the previous value.
|
long |
incrementAndGet()
Atomically increments the current value by one.
|
int |
intValue()
Returns the value as an
int . |
void |
lazySet(long newValue)
Eventually sets to the given value.
|
long |
longValue()
Returns the value as a
long . |
void |
set(long newValue)
Sets to the given value.
|
java.lang.String |
toString()
Returns the String representation of the current value.
|
long |
updateAndGet(java.util.function.LongUnaryOperator updateFunction)
Atomically updates the current value with the results of
applying the given function, returning the updated value.
|
boolean |
weakCompareAndSet(long expect,
long update)
Atomically sets the value to the given updated value
if the current value
== the expected value. |
casVal, getAndAddVal, getAndSetVal, lpVal, lvVal, soVal, spVal, svVal
public PaddedAtomicLong()
0
.public PaddedAtomicLong(long initialValue)
initialValue
- the initial valuepublic long get()
AtomicLong.get()
public void set(long newValue)
newValue
- the new valueAtomicLong.set(long)
public void lazySet(long newValue)
newValue
- the new valueAtomicLong.lazySet(long)
public long getAndSet(long newValue)
newValue
- the new valueAtomicLong.getAndSet(long)
public boolean compareAndSet(long expect, long update)
==
the expected value.expect
- the expected valueupdate
- the new valuetrue
if successful. False return indicates that
the actual value was not equal to the expected value.AtomicLong.compareAndSet(long, long)
public boolean weakCompareAndSet(long expect, long update)
==
the expected value.
May fail
spuriously and does not provide ordering guarantees, so is
only rarely an appropriate alternative to compareAndSet
.
expect
- the expected valueupdate
- the new valuetrue
if successfulAtomicLong.weakCompareAndSet(long, long)
public long getAndIncrement()
AtomicLong.getAndIncrement()
public long getAndDecrement()
AtomicLong.getAndDecrement()
public long getAndAdd(long delta)
delta
- the value to addAtomicLong.getAndAdd(long)
public long incrementAndGet()
AtomicLong.incrementAndGet()
public long decrementAndGet()
AtomicLong.decrementAndGet()
public long addAndGet(long delta)
delta
- the value to addAtomicLong.addAndGet(long)
public long getAndUpdate(java.util.function.LongUnaryOperator updateFunction)
updateFunction
- a side-effect-free functionAtomicLong.getAndUpdate(LongUnaryOperator)
public long updateAndGet(java.util.function.LongUnaryOperator updateFunction)
updateFunction
- a side-effect-free functionAtomicLong.updateAndGet(LongUnaryOperator)
public long getAndAccumulate(long v, java.util.function.LongBinaryOperator f)
v
- the update valuef
- a side-effect-free function of two argumentsAtomicLong.getAndAccumulate(long, LongBinaryOperator)
public long accumulateAndGet(long x, java.util.function.LongBinaryOperator f)
AtomicLong.accumulateAndGet(long, LongBinaryOperator)
public java.lang.String toString()
toString
in class java.lang.Object
public int intValue()
int
.intValue
in class java.lang.Number
AtomicLong.intValue()
public long longValue()
long
.longValue
in class java.lang.Number
AtomicLong.longValue()
public float floatValue()
float
.floatValue
in class java.lang.Number
AtomicLong.floatValue()
public double doubleValue()
double
.doubleValue
in class java.lang.Number
AtomicLong.doubleValue()