Class EnumIndex<T extends Enum<T>>

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

public class EnumIndex<T extends Enum<T>> extends Object implements Index<T>
Wraps an enumeration class to get all the access methods to the enums values, as defined by Index
See Also:
  • Constructor Details

    • EnumIndex

      public EnumIndex(Class<T> cls)
  • Method Details

    • iterator

      public Iterator<T> iterator()
      Specified by:
      iterator in interface Iterable<T extends Enum<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 extends Enum<T>>
      Returns:
      the number of objects in this index.
    • 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 extends Enum<T>>
      Returns:
      the object associated with a given number.
    • contains

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

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

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

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