Package 

Class AtomicDoubleArray64Iterator

  • All Implemented Interfaces:
    io.github.millibyte1.array64.Array64Iterator , io.github.millibyte1.array64.LongIndexedIterator , io.github.millibyte1.array64.atomic.AtomicArray64Iterator , kotlin.collections.Iterator

    
    public abstract class AtomicDoubleArray64Iterator
    extends DoubleArray64Iterator implements AtomicArray64Iterator<Double>
                        

    A DoubleArray64Iterator which supports atomic operations such as compareAndSet.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final Long index
    • Method Summary

      Modifier and Type Method Description
      abstract Long getIndex() The current index of this iterator.
      abstract Double previousDouble() Returns the next element in the iteration without boxing.
      abstract Double nextDouble() Returns the previous element in the iteration without boxing.
      abstract Unit setDouble(Double element) Replaces the element at the current index with the specified primitive.
      abstract Double getAndSetDouble(Double new) Sets the element at the current index to the given new value and returns the old value.
      abstract Double getAndSetDouble(Function1<Double, Double> transform) Sets the element at the current index to the value resulting from applying the given transform to the old value.
      abstract Double setAndGetDouble(Function1<Double, Double> transform) Sets the element at the current index to the resulting value from applying the given transform to the old value.
      abstract Boolean compareAndSetDouble(Double new, Double expected) Sets the element at the current index to the given new value if the current value matches expected.
      abstract Boolean compareAndSetDouble(Double new, Function2<Double, Double, Boolean> predicate) Sets the element at the current index to the given new value if the provided predicate returns true when applied to the old and new values.
      abstract Unit lazySetDouble(Double value) Eventually sets the element at the given index to the given value.
      final Double getAndSet(Double new) Sets the element at the current index to the given new value and returns the old value.
      final Double getAndSet(Function1<Double, Double> transform) Sets the element at the current index to the value resulting from applying the given transform to the old value.
      final Double setAndGet(Function1<Double, Double> transform) Sets the element at the current index to the resulting value from applying the given transform to the old value.
      final Boolean compareAndSet(Double new, Double expected) Sets the element at the current index to the given new value if the current value matches expected.
      final Boolean compareAndSet(Double new, Function2<Double, Double, Boolean> predicate) Sets the element at the current index to the given new value if the provided predicate returns true when applied to the old and new values.
      final Unit lazySet(Double value) Eventually sets the element at the given index to the given value.
      • Methods inherited from class io.github.millibyte1.array64.atomic.AtomicDoubleArray64Iterator

        previous, set
      • Methods inherited from class kotlin.collections.DoubleIterator

        forEachRemaining, hasNext
      • Methods inherited from class io.github.millibyte1.array64.DoubleArray64Iterator

        hasPrevious, next
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AtomicDoubleArray64Iterator

        AtomicDoubleArray64Iterator()
    • Method Detail

      • getIndex

         abstract Long getIndex()

        The current index of this iterator.

      • previousDouble

         abstract Double previousDouble()

        Returns the next element in the iteration without boxing. Volatile.

      • nextDouble

         abstract Double nextDouble()

        Returns the previous element in the iteration without boxing. Volatile.

      • setDouble

         abstract Unit setDouble(Double element)

        Replaces the element at the current index with the specified primitive. Volatile.

      • getAndSetDouble

         abstract Double getAndSetDouble(Double new)

        Sets the element at the current index to the given new value and returns the old value. Atomic.

        Parameters:
        new - the value to set the element to
      • getAndSetDouble

         abstract Double getAndSetDouble(Function1<Double, Double> transform)

        Sets the element at the current index to the value resulting from applying the given transform to the old value. Atomic.

        Parameters:
        transform - the pure (side effect-free) transform function to apply to the old value
      • setAndGetDouble

         abstract Double setAndGetDouble(Function1<Double, Double> transform)

        Sets the element at the current index to the resulting value from applying the given transform to the old value. Atomic.

        Parameters:
        transform - the pure (side effect-free) transform function to apply to the old value
      • compareAndSetDouble

         abstract Boolean compareAndSetDouble(Double new, Double expected)

        Sets the element at the current index to the given new value if the current value matches expected. Atomic.

        Parameters:
        new - the value to set the element to
        expected - the expected value of the element
      • compareAndSetDouble

         abstract Boolean compareAndSetDouble(Double new, Function2<Double, Double, Boolean> predicate)

        Sets the element at the current index to the given new value if the provided predicate returns true when applied to the old and new values.

        Parameters:
        new - the value to set the element to
        predicate - the binary predicate to apply to the old and new values to decide whether to update
      • lazySetDouble

         abstract Unit lazySetDouble(Double value)

        Eventually sets the element at the given index to the given value. Depending on the implementation, may immediately perform a volatile write.

        Parameters:
        value - the value to set the element to
      • getAndSet

         final Double getAndSet(Double new)

        Sets the element at the current index to the given new value and returns the old value. Atomic.

        Parameters:
        new - the value to set the element to
      • getAndSet

         final Double getAndSet(Function1<Double, Double> transform)

        Sets the element at the current index to the value resulting from applying the given transform to the old value. Atomic.

        Parameters:
        transform - the pure (side effect-free) transform function to apply to the old value
      • setAndGet

         final Double setAndGet(Function1<Double, Double> transform)

        Sets the element at the current index to the resulting value from applying the given transform to the old value. Atomic.

        Parameters:
        transform - the pure (side effect-free) transform function to apply to the old value
      • compareAndSet

         final Boolean compareAndSet(Double new, Double expected)

        Sets the element at the current index to the given new value if the current value matches expected. Atomic.

        Parameters:
        new - the value to set the element to
        expected - the expected value of the element
      • compareAndSet

         final Boolean compareAndSet(Double new, Function2<Double, Double, Boolean> predicate)

        Sets the element at the current index to the given new value if the provided predicate returns true when applied to the old and new values.

        Parameters:
        new - the value to set the element to
        predicate - the binary predicate to apply to the old and new values to decide whether to update
      • lazySet

         final Unit lazySet(Double value)

        Eventually sets the element at the given index to the given value. Depending on the implementation, may immediately perform a volatile write.

        Parameters:
        value - the value to set the element to