Top Description Fields Constructors Methods
io.netty5.util.internal.shaded.org.jctools.util

public Class PaddedAtomicLong

Additional top-level classes in compilation unit: PaddedAtomicLongL1Pad, PaddedAtomicLongL1Field, PaddedAtomicLongL2Pad.

extends PaddedAtomicLongL2Pad
Class Inheritance
Imports
java.util.function.LongBinaryOperator, .LongUnaryOperator

A padded version of the java.util.concurrent.atomic.AtomicLong.

Field Summary

Inherited from io.netty5.util.internal.shaded.org.jctools.util.PaddedAtomicLongL2Pad:
b000b001b002b003b004b005b006b007b010b011b012b013b014b015b016b017b020b021b022b023b024b025b026b027b030b031b032b033b034b035b036b037b040b041b042b043b044b045b046b047b050b051b052b053b054b055b056b057b060b061b062b063b064b065b066b067b070b071b072b073b074b075b076b077b100b101b102b103b104b105b106b107b110b111b112b113b114b115b116b117b120b121b122b123b124b125b126b127b130b131b132b133b134b135b136b137b140b141b142b143b144b145b146b147b150b151b152b153b154b155b156b157b160b161b162b163b164b165b166b167b170b171b172b173b174b175b176b177

Constructor Summary

AccessConstructor and Description
public
PaddedAtomicLong()

Creates a new PaddedAtomicLong with initial value 0.

public
PaddedAtomicLong(long
the initial value
initialValue
)

Creates a new PaddedAtomicLong with the given initial value.

Method Summary

Modifier and TypeMethod and Description
public long
public long

Returns:

the updated value
addAndGet
(long
the value to add
delta
)

Atomically adds to current value te given value.

public boolean

Returns:

true if successful. False return indicates that the actual value was not equal to the expected value.
compareAndSet
(long
the expected value
expect
,
long
the new value
update
)

Atomically sets the value to the given updated value if the current value == the expected value.

public long

Returns:

the updated value
decrementAndGet
()

Atomically decrements the current value by one.

public double
doubleValue()

Implements abstract java.lang.Number.doubleValue.

Returns the value of a double.
public float
floatValue()

Implements abstract java.lang.Number.floatValue.

Returns the value of a float.
public long

Returns:

the current value
get
()

Gets the current value.

public long

Returns:

the previous value
getAndAccumulate
(long
the update value
v
,
LongBinaryOperator
a side-effect-free function of two arguments
f
)

Atomically updates the current value with the results of applying the given function to the current and given values, returning the previous value.

public long

Returns:

the previous value
getAndAdd
(long
the value to add
delta
)

Atomically adds to the current value the given value.

public long

Returns:

the previous value
getAndDecrement
()

Atomically decrements the current value by 1.

public long

Returns:

the previous value
getAndIncrement
()

Atomically increments the current value by 1.

public long

Returns:

the previous value
getAndSet
(long
the new value
newValue
)

Atomically sets to the given value and returns the old value.

public long

Returns:

the previous value
getAndUpdate
(LongUnaryOperator
a side-effect-free function
updateFunction
)

Atomically updates the current value with the results of applying the given function, returning the previous value.

public long

Returns:

the updated value
incrementAndGet
()

Atomically increments the current value by one.

public int
intValue()

Implements abstract java.lang.Number.intValue.

Returns the value as an int.
public void
lazySet(long
the new value
newValue
)

Eventually sets to the given value.

public long
longValue()

Implements abstract java.lang.Number.longValue.

Returns the value as a long.
public void
set(long
the new value
newValue
)

Sets to the given value.

public String

Returns:

the String representation of the current value
toString
()

Overrides java.lang.Object.toString.

Returns the String representation of the current value.
public long

Returns:

the updated value
updateAndGet
(LongUnaryOperator
a side-effect-free function
updateFunction
)

Atomically updates the current value with the results of applying the given function, returning the updated value.

public boolean

Returns:

true if successful
weakCompareAndSet
(long
the expected value
expect
,
long
the new value
update
)

Atomically sets the value to the given updated value if the current value == the expected value.

Constructor Detail

PaddedAtomicLongback to summary
public PaddedAtomicLong()

Creates a new PaddedAtomicLong with initial value 0.

PaddedAtomicLongback to summary
public PaddedAtomicLong(long initialValue)

Creates a new PaddedAtomicLong with the given initial value.

Parameters
initialValue:long

the initial value

Method Detail

accumulateAndGetback to summary
public long accumulateAndGet(long x, LongBinaryOperator f)

java.util.concurrent.atomic.AtomicLong#accumulateAndGet(long, LongBinaryOperator)

addAndGetback to summary
public long addAndGet(long delta)

Atomically adds to current value te given value.

Parameters
delta:long

the value to add

Returns:long

the updated value

See Also
java.util.concurrent.atomic.AtomicLong#addAndGet(long)
compareAndSetback to summary
public boolean compareAndSet(long expect, long update)

Atomically sets the value to the given updated value if the current value == the expected value.

Parameters
expect:long

the expected value

update:long

the new value

Returns:boolean

true if successful. False return indicates that the actual value was not equal to the expected value.

See Also
java.util.concurrent.atomic.AtomicLong#compareAndSet(long, long)
decrementAndGetback to summary
public long decrementAndGet()

Atomically decrements the current value by one.

Returns:long

the updated value

See Also
java.util.concurrent.atomic.AtomicLong#decrementAndGet()
doubleValueback to summary
public double doubleValue()

Implements abstract java.lang.Number.doubleValue.

Returns the value of a double.

Returns:double

Doc from java.lang.Number.doubleValue.

the numeric value represented by this object after conversion to type double.

Annotations
@Override
See Also
java.util.concurrent.atomic.AtomicLong#doubleValue()
floatValueback to summary
public float floatValue()

Implements abstract java.lang.Number.floatValue.

Returns the value of a float.

Returns:float

Doc from java.lang.Number.floatValue.

the numeric value represented by this object after conversion to type float.

Annotations
@Override
See Also
java.util.concurrent.atomic.AtomicLong#floatValue()
getback to summary
public long get()

Gets the current value.

Returns:long

the current value

See Also
java.util.concurrent.atomic.AtomicLong#get()
getAndAccumulateback to summary
public long getAndAccumulate(long v, 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. The function should be side-effect-free, since it may be re-applied when attempted updates fail due to contention among threads. The function is applied with the current value as its first argument, and the given update as the second argument.

Parameters
v:long

the update value

f:LongBinaryOperator

a side-effect-free function of two arguments

Returns:long

the previous value

See Also
java.util.concurrent.atomic.AtomicLong#getAndAccumulate(long, LongBinaryOperator)
getAndAddback to summary
public long getAndAdd(long delta)

Atomically adds to the current value the given value.

Parameters
delta:long

the value to add

Returns:long

the previous value

See Also
java.util.concurrent.atomic.AtomicLong#getAndAdd(long)
getAndDecrementback to summary
public long getAndDecrement()

Atomically decrements the current value by 1.

Returns:long

the previous value

See Also
java.util.concurrent.atomic.AtomicLong#getAndDecrement()
getAndIncrementback to summary
public long getAndIncrement()

Atomically increments the current value by 1.

Returns:long

the previous value

See Also
java.util.concurrent.atomic.AtomicLong#getAndIncrement()
getAndSetback to summary
public long getAndSet(long newValue)

Atomically sets to the given value and returns the old value.

Parameters
newValue:long

the new value

Returns:long

the previous value

See Also
java.util.concurrent.atomic.AtomicLong#getAndSet(long)
getAndUpdateback to summary
public long getAndUpdate(LongUnaryOperator updateFunction)

Atomically updates the current value with the results of applying the given function, returning the previous value. The function should be side-effect-free, since it may be re-applied when attempted updates fail due to contention among threads.

Parameters
updateFunction:LongUnaryOperator

a side-effect-free function

Returns:long

the previous value

See Also
java.util.concurrent.atomic.AtomicLong#getAndUpdate(LongUnaryOperator)
incrementAndGetback to summary
public long incrementAndGet()

Atomically increments the current value by one.

Returns:long

the updated value

See Also
java.util.concurrent.atomic.AtomicLong#incrementAndGet()
intValueback to summary
public int intValue()

Implements abstract java.lang.Number.intValue.

Returns the value as an int.

Returns:int

Doc from java.lang.Number.intValue.

the numeric value represented by this object after conversion to type int.

Annotations
@Override
See Also
java.util.concurrent.atomic.AtomicLong#intValue()
lazySetback to summary
public void lazySet(long newValue)

Eventually sets to the given value.

Parameters
newValue:long

the new value

See Also
java.util.concurrent.atomic.AtomicLong#lazySet(long)
longValueback to summary
public long longValue()

Implements abstract java.lang.Number.longValue.

Returns the value as a long.

Returns:long

Doc from java.lang.Number.longValue.

the numeric value represented by this object after conversion to type long.

Annotations
@Override
See Also
java.util.concurrent.atomic.AtomicLong#longValue()
setback to summary
public void set(long newValue)

Sets to the given value.

Parameters
newValue:long

the new value

See Also
java.util.concurrent.atomic.AtomicLong#set(long)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns the String representation of the current value.

Returns:String

the String representation of the current value

Annotations
@Override
updateAndGetback to summary
public long updateAndGet(LongUnaryOperator updateFunction)

Atomically updates the current value with the results of applying the given function, returning the updated value. The function should be side-effect-free, since it may be re-applied when attempted updates fail due to contention among threads.

Parameters
updateFunction:LongUnaryOperator

a side-effect-free function

Returns:long

the updated value

See Also
java.util.concurrent.atomic.AtomicLong#updateAndGet(LongUnaryOperator)
weakCompareAndSetback to summary
public boolean weakCompareAndSet(long expect, long update)

Atomically sets the value to the given updated value if the current value == the expected value.

May fail spuriously and does not provide ordering guarantees, so is only rarely an appropriate alternative to compareAndSet.

Parameters
expect:long

the expected value

update:long

the new value

Returns:boolean

true if successful

See Also
java.util.concurrent.atomic.AtomicLong#weakCompareAndSet(long, long)