Class ObjectStore<T>

java.lang.Object
ObjectStore<T>
All Implemented Interfaces:
Array.Store<T>, Serializable

public final class ObjectStore<T> extends Object implements Array.Store<T>, Serializable
Since:
6.0
Version:
6.0
See Also:
  • Method Details

    • set

      public void set(int index, T value)
      Description copied from interface: Array.Store
      Write the given value at the given index to the underlying array structure.
      Specified by:
      set in interface Array.Store<T>
      Parameters:
      index - the array index
      value - the value to set
    • get

      public T get(int index)
      Description copied from interface: Array.Store
      Return the value at the given array index.
      Specified by:
      get in interface Array.Store<T>
      Parameters:
      index - the array index
      Returns:
      the value at the given index
    • sort

      public void sort(int from, int until, Comparator<? super T> comparator)
      Description copied from interface: Array.Store
      Sort the store.
      Specified by:
      sort in interface Array.Store<T>
      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
    • copy

      public ObjectStore<T> copy(int from, int until)
      Description copied from interface: Array.Store
      Return a new array Store with the copied portion of the underlying array.
      Specified by:
      copy in interface Array.Store<T>
      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
    • newInstance

      public ObjectStore<T> newInstance(int length)
      Description copied from interface: Array.Store
      Return a new Store of the same type and the given length.
      Specified by:
      newInstance in interface Array.Store<T>
      Parameters:
      length - the length of the new store
      Returns:
      a new Store of the same type and the given length.
    • length

      public int length()
      Description copied from interface: Array.Store
      Return the length of the array Store.
      Specified by:
      length in interface Array.Store<T>
      Returns:
      the array store length
    • of

      public static <T> ObjectStore<T> of(Object[] array)
    • ofLength

      public static <T> ObjectStore<T> ofLength(int length)