Package 

Class AtomicFloatArray64Iterator

  • 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 AtomicFloatArray64Iterator
    extends FloatArray64Iterator implements AtomicArray64Iterator<Float>
                        

    A FloatArray64Iterator 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 Float previousFloat() Returns the next element in the iteration without boxing.
      abstract Float nextFloat() Returns the previous element in the iteration without boxing.
      abstract Unit setFloat(Float element) Replaces the element at the current index with the specified primitive.
      abstract Float getAndSetFloat(Float new) Sets the element at the current index to the given new value and returns the old value.
      abstract Float getAndSetFloat(Function1<Float, Float> transform) Sets the element at the current index to the value resulting from applying the given transform to the old value.
      abstract Float setAndGetFloat(Function1<Float, Float> transform) Sets the element at the current index to the resulting value from applying the given transform to the old value.
      abstract Boolean compareAndSetFloat(Float new, Float expected) Sets the element at the current index to the given new value if the current value matches expected.
      abstract Boolean compareAndSetFloat(Float new, Function2<Float, Float, 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 lazySetFloat(Float value) Eventually sets the element at the given index to the given value.
      final Float getAndSet(Float new) Sets the element at the current index to the given new value and returns the old value.
      final Float getAndSet(Function1<Float, Float> transform) Sets the element at the current index to the value resulting from applying the given transform to the old value.
      final Float setAndGet(Function1<Float, Float> transform) Sets the element at the current index to the resulting value from applying the given transform to the old value.
      final Boolean compareAndSet(Float new, Float expected) Sets the element at the current index to the given new value if the current value matches expected.
      final Boolean compareAndSet(Float new, Function2<Float, Float, 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(Float value) Eventually sets the element at the given index to the given value.
      • Methods inherited from class io.github.millibyte1.array64.atomic.AtomicFloatArray64Iterator

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

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

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

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

      • AtomicFloatArray64Iterator

        AtomicFloatArray64Iterator()
    • Method Detail

      • getIndex

         abstract Long getIndex()

        The current index of this iterator.

      • previousFloat

         abstract Float previousFloat()

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

      • nextFloat

         abstract Float nextFloat()

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

      • setFloat

         abstract Unit setFloat(Float element)

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

      • getAndSetFloat

         abstract Float getAndSetFloat(Float 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
      • getAndSetFloat

         abstract Float getAndSetFloat(Function1<Float, Float> 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
      • setAndGetFloat

         abstract Float setAndGetFloat(Function1<Float, Float> 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
      • compareAndSetFloat

         abstract Boolean compareAndSetFloat(Float new, Float 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
      • compareAndSetFloat

         abstract Boolean compareAndSetFloat(Float new, Function2<Float, Float, 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
      • lazySetFloat

         abstract Unit lazySetFloat(Float 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 Float getAndSet(Float 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 Float getAndSet(Function1<Float, Float> 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 Float setAndGet(Function1<Float, Float> 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(Float new, Float 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(Float new, Function2<Float, Float, 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(Float 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