class AtomicReferenceArray[E <: AnyRef] extends Serializable
- Alphabetic
- By Inheritance
- AtomicReferenceArray
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new AtomicReferenceArray(array: Array[E])
Creates a new AtomicReferenceArray with the same length as, and all elements copied from, the given array.
Creates a new AtomicReferenceArray with the same length as, and all elements copied from, the given array.
- array
the array to copy elements from
- Exceptions thrown
java.lang.NullPointerException
if array is null
- new AtomicReferenceArray(length: Int)
Creates a new AtomicReferenceArray of the given length, with all elements initially null.
Creates a new AtomicReferenceArray of the given length, with all elements initially null.
- length
the length of the array
- new AtomicReferenceArray()
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def accumulateAndGet(i: Int, x: E, accumulatorFunction: BinaryOperator[E]): E
Atomically updates (with memory effects as specified by
VarHandle#compareAndSet
) the element at indexi
with the results of applying the given function to the current and given values, returning tnewNexthe updated value.Atomically updates (with memory effects as specified by
VarHandle#compareAndSet
) the element at indexi
with the results of applying the given function to the current and given values, returning tnewNexthe updated 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 of the element at indexi
as its first argument, and the given update as the second argument.- i
the index
- x
the update value
- accumulatorFunction
a side-effect-free function of two arguments
- returns
the updated value
- Since
1.8
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def compareAndExchange(i: Int, expectedValue: E, newValue: E): E
Atomically sets the element at index
i
tonewValue
if the element's current value, referred to as the witness value,== expectedValue
, with memory effects as specified byVarHandle#compareAndExchange
.Atomically sets the element at index
i
tonewValue
if the element's current value, referred to as the witness value,== expectedValue
, with memory effects as specified byVarHandle#compareAndExchange
.- i
the index
- expectedValue
the expected value
- newValue
the new value
- returns
the witness value, which will be the same as the expected value if successful
- Since
9
- final def compareAndExchangeAcquire(i: Int, expectedValue: E, newValue: E): E
Atomically sets the element at index
i
tonewValue
if the element's current value, referred to as the witness value,== expectedValue
, with memory effects as specified byVarHandle#compareAndExchangeAcquire
.Atomically sets the element at index
i
tonewValue
if the element's current value, referred to as the witness value,== expectedValue
, with memory effects as specified byVarHandle#compareAndExchangeAcquire
.- i
the index
- expectedValue
the expected value
- newValue
the new value
- returns
the witness value, which will be the same as the expected value if successful
- Since
9
- final def compareAndExchangeRelease(i: Int, expectedValue: E, newValue: E): E
Atomically sets the element at index
i
tonewValue
if the element's current value, referred to as the witness value,== expectedValue
, with memory effects as specified byVarHandle#compareAndExchangeRelease
.Atomically sets the element at index
i
tonewValue
if the element's current value, referred to as the witness value,== expectedValue
, with memory effects as specified byVarHandle#compareAndExchangeRelease
.- i
the index
- expectedValue
the expected value
- newValue
the new value
- returns
the witness value, which will be the same as the expected value if successful
- Since
9
- final def compareAndSet(i: Int, expectedValue: E, newValue: E): Boolean
Atomically sets the element at index
i
tonewValue
if the element's current value== expectedValue
, with memory effects as specified byVarHandle#compareAndSet
.Atomically sets the element at index
i
tonewValue
if the element's current value== expectedValue
, with memory effects as specified byVarHandle#compareAndSet
.- i
the index
- expectedValue
the expected value
- newValue
the new value
- returns
true
if successful. False return indicates that the actual value was not equal to the expected value.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def get(i: Int): E
Returns the current value of the element at index
i
, with memory effects as specified byVarHandle#getVolatile
.Returns the current value of the element at index
i
, with memory effects as specified byVarHandle#getVolatile
.- i
the index
- returns
the current value
- final def getAcquire(i: Int): E
Returns the current value of the element at index
i
, with memory effects as specified byVarHandle#getAcquire
.Returns the current value of the element at index
i
, with memory effects as specified byVarHandle#getAcquire
.- i
the index
- returns
the value
- Since
9
- final def getAndAccumulate(i: Int, x: E, accumulatorFunction: BinaryOperator[E]): E
Atomically updates (with memory effects as specified by
VarHandle#compareAndSet
) the element at indexi
with the results of applying the given function to the current and given values, returning the previous value.Atomically updates (with memory effects as specified by
VarHandle#compareAndSet
) the element at indexi
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 of the element at indexi
as its first argument, and the given update as the second argument.- i
the index
- x
the update value
- accumulatorFunction
a side-effect-free function of two arguments
- returns
the previous value
- Since
1.8
- final def getAndSet(i: Int, newValue: E): E
Atomically sets the element at index
i
tonewValue
and returns the old value, with memory effects as specified byVarHandle#getAndSet
.Atomically sets the element at index
i
tonewValue
and returns the old value, with memory effects as specified byVarHandle#getAndSet
.- i
the index
- newValue
the new value
- returns
the previous value
- final def getAndUpdate(i: Int, updateFunction: UnaryOperator[E]): E
Atomically updates (with memory effects as specified by
VarHandle#compareAndSet
) the element at indexi
with the results of applying the given function, returning the previous value.Atomically updates (with memory effects as specified by
VarHandle#compareAndSet
) the element at indexi
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.- i
the index
- updateFunction
a side-effect-free function
- returns
the previous value
- Since
1.8
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def getOpaque(i: Int): E
Returns the current value of the element at index
i
, with memory effects as specified byVarHandle#getOpaque
.Returns the current value of the element at index
i
, with memory effects as specified byVarHandle#getOpaque
.- i
the index
- returns
the value
- Since
9
- final def getPlain(i: Int): E
Returns the current value of the element at index
i
, with memory semantics of reading as if the variable was declared non-volatile
.Returns the current value of the element at index
i
, with memory semantics of reading as if the variable was declared non-volatile
.- i
the index
- returns
the value
- Since
9
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def lazySet(i: Int, newValue: E): Unit
Sets the element at index
i
tonewValue
, with memory effects as specified byVarHandle#setRelease
.Sets the element at index
i
tonewValue
, with memory effects as specified byVarHandle#setRelease
.- i
the index
- newValue
the new value
- Since
1.6
- final def length(): Int
Returns the length of the array.
Returns the length of the array.
- returns
the length of the array
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def set(i: Int, newValue: E): Unit
Sets the element at index
i
tonewValue
, with memory effects as specified byVarHandle#setVolatile
.Sets the element at index
i
tonewValue
, with memory effects as specified byVarHandle#setVolatile
.- i
the index
- newValue
the new value
- final def setOpaque(i: Int, newValue: E): Unit
Sets the element at index
i
tonewValue
, with memory effects as specified byVarHandle#setOpaque
.Sets the element at index
i
tonewValue
, with memory effects as specified byVarHandle#setOpaque
.- i
the index
- newValue
the new value
- Since
9
- final def setPlain(i: Int, newValue: E): Unit
Sets the element at index
i
tonewValue
, with memory semantics of setting as if the variable was declared non-volatile
and non-final
.Sets the element at index
i
tonewValue
, with memory semantics of setting as if the variable was declared non-volatile
and non-final
.- i
the index
- newValue
the new value
- Since
9
- final def setRelease(i: Int, newValue: E): Unit
Sets the element at index
i
tonewValue
, with memory effects as specified byVarHandle#setRelease
.Sets the element at index
i
tonewValue
, with memory effects as specified byVarHandle#setRelease
.- i
the index
- newValue
the new value
- Since
9
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
Returns the String representation of the current values of array.
Returns the String representation of the current values of array.
- returns
the String representation of the current values of array
- Definition Classes
- AtomicReferenceArray → AnyRef → Any
- final def updateAndGet(i: Int, updateFunction: UnaryOperator[E]): E
Atomically updates (with memory effects as specified by
VarHandle#compareAndSet
) the element at indexi
with the results of applying the given function, returning the updated value.Atomically updates (with memory effects as specified by
VarHandle#compareAndSet
) the element at indexi
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.- i
the index
- updateFunction
a side-effect-free function
- returns
the updated value
- Since
1.8
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def weakCompareAndSetAcquire(i: Int, expectedValue: E, newValue: E): Boolean
Possibly atomically sets the element at index
i
tonewValue
if the element's current value== expectedValue
, with memory effects as specified byVarHandle#weakCompareAndSetAcquire
.Possibly atomically sets the element at index
i
tonewValue
if the element's current value== expectedValue
, with memory effects as specified byVarHandle#weakCompareAndSetAcquire
.- i
the index
- expectedValue
the expected value
- newValue
the new value
- returns
true
if successful
- Since
9
- final def weakCompareAndSetPlain(i: Int, expectedValue: E, newValue: E): Boolean
Possibly atomically sets the element at index
i
tonewValue
if the element's current value== expectedValue
, with memory effects as specified byVarHandle#weakCompareAndSetPlain
.Possibly atomically sets the element at index
i
tonewValue
if the element's current value== expectedValue
, with memory effects as specified byVarHandle#weakCompareAndSetPlain
.- i
the index
- expectedValue
the expected value
- newValue
the new value
- returns
true
if successful
- Since
9
- final def weakCompareAndSetRelease(i: Int, expectedValue: E, newValue: E): Boolean
Possibly atomically sets the element at index
i
tonewValue
if the element's current value== expectedValue
, with memory effects as specified byVarHandle#weakCompareAndSetRelease
.Possibly atomically sets the element at index
i
tonewValue
if the element's current value== expectedValue
, with memory effects as specified byVarHandle#weakCompareAndSetRelease
.- i
the index
- expectedValue
the expected value
- newValue
the new value
- returns
true
if successful
- Since
9
- final def weakCompareAndSetVolatile(i: Int, expectedValue: E, newValue: E): Boolean
Possibly atomically sets the element at index
i
tonewValue
if the element's current value== expectedValue
, with memory effects as specified byVarHandle#weakCompareAndSet
.Possibly atomically sets the element at index
i
tonewValue
if the element's current value== expectedValue
, with memory effects as specified byVarHandle#weakCompareAndSet
.- i
the index
- expectedValue
the expected value
- newValue
the new value
- returns
true
if successful
- Since
9
Deprecated Value Members
- final def weakCompareAndSet(i: Int, expectedValue: E, newValue: E): Boolean
Possibly atomically sets the element at index
i
tonewValue
if the element's current value== expectedValue
, with memory effects as specified byVarHandle#weakCompareAndSetPlain
.Possibly atomically sets the element at index
i
tonewValue
if the element's current value== expectedValue
, with memory effects as specified byVarHandle#weakCompareAndSetPlain
.- i
the index
- expectedValue
the expected value
- newValue
the new value
- returns
true
if successful
- Annotations
- @deprecated
- Deprecated
(Since version 9)
- See also
#weakCompareAndSetPlain