Interface Indexed<T>

All Known Subinterfaces:
IArray<T>, IDeque<T>, IList<T>
All Known Implementing Classes:
ArrayDeque, IndexedArray, IndexedList, Subindexed, TreeList, TrieArray

public interface Indexed<T>
Interface for containers that allow access to values by an integer index.
  • Method Summary

    Modifier and Type
    Method
    Description
    find(int index)
    Retrieves a Holder containing the (possibly null) value at the specified index if it exists.
    get(int index)
    Retrieve the value.
    default Indexed<T>
    prefix(int size)
     
    default Indexed<T>
     
    int
    Retrieve the number of values available in the container.
    default <U> Indexed<U>
    transformed(Func1<T,U> transforminator)
     
  • Method Details

    • get

      T get(int index)
      Retrieve the value. The index must be valid for the container's current size (i.e. [0-size)
      Throws:
      IndexOutOfBoundsException - if index is out of bounds
    • size

      int size()
      Retrieve the number of values available in the container.
    • find

      @Nonnull Maybe<T> find(int index)
      Retrieves a Holder containing the (possibly null) value at the specified index if it exists. If no such value exists returns an empty Holder.
    • transformed

      default <U> Indexed<U> transformed(Func1<T,U> transforminator)
    • reversed

      @Nonnull default Indexed<T> reversed()
    • prefix

      @Nonnull default Indexed<T> prefix(int size)