Package 

Interface AtomicCharArray64

  • All Implemented Interfaces:
    io.github.millibyte1.array64.Array64 , io.github.millibyte1.array64.atomic.AtomicArray64 , kotlin.collections.Iterable

    
    public interface AtomicCharArray64
     implements AtomicArray64<Char>
                        

    Marker interface for AtomicArray64s of unboxed primitive Chars.

    • Method Detail

      • get

         abstract Character get(Long index)

        Returns the element at the given index. Volatile.

        Parameters:
        index - the index of the desired element
      • set

         abstract Unit set(Long index, Character value)

        Sets the element at the given index to the given value. Volatile.

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

         abstract Character getAndSet(Long index, Character new)

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

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

         abstract Character getAndSet(Long index, Function1<Character, Character> transform)

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

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

         abstract Character setAndGet(Long index, Function1<Character, Character> transform)

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

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

         abstract Boolean compareAndSet(Long index, Character new, Character expected)

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

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

         abstract Boolean compareAndSet(Long index, Character new, Function2<Character, Character, Boolean> predicate)

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

        Parameters:
        index - the index of the element to try and set
        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

         abstract Unit lazySet(Long index, Character value)

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

        Parameters:
        index - the index of the element to set
        value - the value to set the element to
      • size

         abstract Long size()

        The number of elements in this array.