Class ArrayIndex<T>

java.lang.Object
eu.bandm.tools.ops.ArrayIndex<T>
All Implemented Interfaces:
Index<T>, Serializable, Iterable<T>

public class ArrayIndex<T> extends Object implements Index<T>
Sorted list of instances of T for indexed representation, realized internally by an array.
See Also:
  • Constructor Details

    • ArrayIndex

      public ArrayIndex(Comparator<? super T> order, T... items)
  • Method Details

    • natural

      public static <T extends Comparable<? super T>> ArrayIndex<T> natural(T... items)
    • iterator

      public Iterator<T> iterator()
      Specified by:
      iterator in interface Iterable<T>
    • size

      public int size()
      Description copied from interface: Index
      Returns the number of objects in this index. This number is nonnegative.
      Specified by:
      size in interface Index<T>
      Returns:
      the number of objects in this index.
    • contains

      public boolean contains(T t)
      Specified by:
      contains in interface Index<T>
    • containsUnchecked

      public boolean containsUnchecked(Object t)
      Specified by:
      containsUnchecked in interface Index<T>
    • indexOf

      public int indexOf(T t)
      Specified by:
      indexOf in interface Index<T>
    • indexOfUnchecked

      public int indexOfUnchecked(Object t)
      Specified by:
      indexOfUnchecked in interface Index<T>
    • get

      public T get(int i)
      Description copied from interface: Index
      Returns the object associated with a given number.
      Specified by:
      get in interface Index<T>
      Returns:
      the object associated with a given number.