Interface Array.Store<T>

Type Parameters:
T - the array element type
All Known Implementing Classes:
Array.Store.Ref, CharStore, ObjectStore
Enclosing class:
Array<T>

public static interface Array.Store<T>
Minimal interface for accessing an underlying array structure.
Since:
3.4
Version:
3.4
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    Mutable reference of an underlying array Store.
  • Method Summary

    Modifier and Type
    Method
    Description
    default Array.Store<T>
    Return a new array Store copy.
    default Array.Store<T>
    copy(int from)
    Return a new array Store with the copied portion of the underlying array.
    copy(int from, int until)
    Return a new array Store with the copied portion of the underlying array.
    get(int index)
    Return the value at the given array index.
    int
    Return the length of the array Store.
    newInstance(int length)
    Return a new Store of the same type and the given length.
    void
    set(int index, T value)
    Write the given value at the given index to the underlying array structure.
    void
    sort(int from, int until, Comparator<? super T> comparator)
    Sort the store.
  • Method Details

    • set

      void set(int index, T value)
      Write the given value at the given index to the underlying array structure.
      Parameters:
      index - the array index
      value - the value to set
    • get

      T get(int index)
      Return the value at the given array index.
      Parameters:
      index - the array index
      Returns:
      the value at the given index
    • sort

      void sort(int from, int until, Comparator<? super T> comparator)
      Sort the store.
      Parameters:
      from - the start index where to start sorting (inclusively)
      until - the end index where to stop sorting (exclusively)
      comparator - the Comparator used to compare sequence elements. A null value indicates that the elements' Comparable natural ordering should be used
    • length

      int length()
      Return the length of the array Store.
      Returns:
      the array store length
    • copy

      Array.Store<T> copy(int from, int until)
      Return a new array Store with the copied portion of the underlying array.
      Parameters:
      from - the start index of the copied array
      until - the end index of the copied array
      Returns:
      a new copy of the given range
    • copy

      default Array.Store<T> copy(int from)
      Return a new array Store with the copied portion of the underlying array.
      Parameters:
      from - the start index of the copied array
      Returns:
      a new copy of the given range
    • copy

      default Array.Store<T> copy()
      Return a new array Store copy.
      Returns:
      a new array Store copy
    • newInstance

      Array.Store<T> newInstance(int length)
      Return a new Store of the same type and the given length.
      Parameters:
      length - the length of the new store
      Returns:
      a new Store of the same type and the given length.
      Throws:
      NegativeArraySizeException - if the length is smaller than zero