c

java.util.concurrent.atomic

AtomicReferenceArray

class AtomicReferenceArray[E <: AnyRef] extends Serializable

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. AtomicReferenceArray
  2. Serializable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. 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

  2. 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

  3. new AtomicReferenceArray()

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def accumulateAndGet(i: Int, x: E, accumulatorFunction: BinaryOperator[E]): E

    Atomically updates (with memory effects as specified by VarHandle#compareAndSet) the element at index i 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 index i 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 index i 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

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  7. final def compareAndExchange(i: Int, expectedValue: E, newValue: E): E

    Atomically sets the element at index i to newValue if the element's current value, referred to as the witness value, == expectedValue, with memory effects as specified by VarHandle#compareAndExchange.

    Atomically sets the element at index i to newValue if the element's current value, referred to as the witness value, == expectedValue, with memory effects as specified by VarHandle#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

  8. final def compareAndExchangeAcquire(i: Int, expectedValue: E, newValue: E): E

    Atomically sets the element at index i to newValue if the element's current value, referred to as the witness value, == expectedValue, with memory effects as specified by VarHandle#compareAndExchangeAcquire.

    Atomically sets the element at index i to newValue if the element's current value, referred to as the witness value, == expectedValue, with memory effects as specified by VarHandle#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

  9. final def compareAndExchangeRelease(i: Int, expectedValue: E, newValue: E): E

    Atomically sets the element at index i to newValue if the element's current value, referred to as the witness value, == expectedValue, with memory effects as specified by VarHandle#compareAndExchangeRelease.

    Atomically sets the element at index i to newValue if the element's current value, referred to as the witness value, == expectedValue, with memory effects as specified by VarHandle#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

  10. final def compareAndSet(i: Int, expectedValue: E, newValue: E): Boolean

    Atomically sets the element at index i to newValue if the element's current value == expectedValue, with memory effects as specified by VarHandle#compareAndSet.

    Atomically sets the element at index i to newValue if the element's current value == expectedValue, with memory effects as specified by VarHandle#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.

  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  14. final def get(i: Int): E

    Returns the current value of the element at index i, with memory effects as specified by VarHandle#getVolatile.

    Returns the current value of the element at index i, with memory effects as specified by VarHandle#getVolatile.

    i

    the index

    returns

    the current value

  15. final def getAcquire(i: Int): E

    Returns the current value of the element at index i, with memory effects as specified by VarHandle#getAcquire.

    Returns the current value of the element at index i, with memory effects as specified by VarHandle#getAcquire.

    i

    the index

    returns

    the value

    Since

    9

  16. final def getAndAccumulate(i: Int, x: E, accumulatorFunction: BinaryOperator[E]): E

    Atomically updates (with memory effects as specified by VarHandle#compareAndSet) the element at index i 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 index i 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 index i 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

  17. final def getAndSet(i: Int, newValue: E): E

    Atomically sets the element at index i to newValue and returns the old value, with memory effects as specified by VarHandle#getAndSet.

    Atomically sets the element at index i to newValue and returns the old value, with memory effects as specified by VarHandle#getAndSet.

    i

    the index

    newValue

    the new value

    returns

    the previous value

  18. final def getAndUpdate(i: Int, updateFunction: UnaryOperator[E]): E

    Atomically updates (with memory effects as specified by VarHandle#compareAndSet) the element at index i 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 index i 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

  19. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  20. final def getOpaque(i: Int): E

    Returns the current value of the element at index i, with memory effects as specified by VarHandle#getOpaque.

    Returns the current value of the element at index i, with memory effects as specified by VarHandle#getOpaque.

    i

    the index

    returns

    the value

    Since

    9

  21. 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

  22. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  23. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  24. final def lazySet(i: Int, newValue: E): Unit

    Sets the element at index i to newValue, with memory effects as specified by VarHandle#setRelease.

    Sets the element at index i to newValue, with memory effects as specified by VarHandle#setRelease.

    i

    the index

    newValue

    the new value

    Since

    1.6

  25. final def length(): Int

    Returns the length of the array.

    Returns the length of the array.

    returns

    the length of the array

  26. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  27. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  28. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  29. final def set(i: Int, newValue: E): Unit

    Sets the element at index i to newValue, with memory effects as specified by VarHandle#setVolatile.

    Sets the element at index i to newValue, with memory effects as specified by VarHandle#setVolatile.

    i

    the index

    newValue

    the new value

  30. final def setOpaque(i: Int, newValue: E): Unit

    Sets the element at index i to newValue, with memory effects as specified by VarHandle#setOpaque.

    Sets the element at index i to newValue, with memory effects as specified by VarHandle#setOpaque.

    i

    the index

    newValue

    the new value

    Since

    9

  31. final def setPlain(i: Int, newValue: E): Unit

    Sets the element at index i to newValue, with memory semantics of setting as if the variable was declared non-volatile and non-final.

    Sets the element at index i to newValue, 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

  32. final def setRelease(i: Int, newValue: E): Unit

    Sets the element at index i to newValue, with memory effects as specified by VarHandle#setRelease.

    Sets the element at index i to newValue, with memory effects as specified by VarHandle#setRelease.

    i

    the index

    newValue

    the new value

    Since

    9

  33. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  34. 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
  35. final def updateAndGet(i: Int, updateFunction: UnaryOperator[E]): E

    Atomically updates (with memory effects as specified by VarHandle#compareAndSet) the element at index i 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 index i 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

  36. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  37. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  38. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  39. final def weakCompareAndSetAcquire(i: Int, expectedValue: E, newValue: E): Boolean

    Possibly atomically sets the element at index i to newValue if the element's current value == expectedValue, with memory effects as specified by VarHandle#weakCompareAndSetAcquire.

    Possibly atomically sets the element at index i to newValue if the element's current value == expectedValue, with memory effects as specified by VarHandle#weakCompareAndSetAcquire.

    i

    the index

    expectedValue

    the expected value

    newValue

    the new value

    returns

    true if successful

    Since

    9

  40. final def weakCompareAndSetPlain(i: Int, expectedValue: E, newValue: E): Boolean

    Possibly atomically sets the element at index i to newValue if the element's current value == expectedValue, with memory effects as specified by VarHandle#weakCompareAndSetPlain.

    Possibly atomically sets the element at index i to newValue if the element's current value == expectedValue, with memory effects as specified by VarHandle#weakCompareAndSetPlain.

    i

    the index

    expectedValue

    the expected value

    newValue

    the new value

    returns

    true if successful

    Since

    9

  41. final def weakCompareAndSetRelease(i: Int, expectedValue: E, newValue: E): Boolean

    Possibly atomically sets the element at index i to newValue if the element's current value == expectedValue, with memory effects as specified by VarHandle#weakCompareAndSetRelease.

    Possibly atomically sets the element at index i to newValue if the element's current value == expectedValue, with memory effects as specified by VarHandle#weakCompareAndSetRelease.

    i

    the index

    expectedValue

    the expected value

    newValue

    the new value

    returns

    true if successful

    Since

    9

  42. final def weakCompareAndSetVolatile(i: Int, expectedValue: E, newValue: E): Boolean

    Possibly atomically sets the element at index i to newValue if the element's current value == expectedValue, with memory effects as specified by VarHandle#weakCompareAndSet.

    Possibly atomically sets the element at index i to newValue if the element's current value == expectedValue, with memory effects as specified by VarHandle#weakCompareAndSet.

    i

    the index

    expectedValue

    the expected value

    newValue

    the new value

    returns

    true if successful

    Since

    9

Deprecated Value Members

  1. final def weakCompareAndSet(i: Int, expectedValue: E, newValue: E): Boolean

    Possibly atomically sets the element at index i to newValue if the element's current value == expectedValue, with memory effects as specified by VarHandle#weakCompareAndSetPlain.

    Possibly atomically sets the element at index i to newValue if the element's current value == expectedValue, with memory effects as specified by VarHandle#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

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped