Interface OrdinalSetMapping<T>

  • All Superinterfaces:
    java.lang.Iterable<T>
    All Known Implementing Classes:
    MutableMapping, ObjectArrayMapping, OffsetOrdinalSetMapping

    public interface OrdinalSetMapping<T>
    extends java.lang.Iterable<T>
    An object that implements a bijection between whole numbers and objects.
    • Method Detail

      • getMappedObject

        T getMappedObject​(int n)
                   throws java.util.NoSuchElementException
        Returns:
        the object numbered n.
        Throws:
        java.util.NoSuchElementException
      • getMappedIndex

        int getMappedIndex​(java.lang.Object o)
        Returns:
        the number of a given object, or -1 if the object is not currently in the range.
      • hasMappedIndex

        boolean hasMappedIndex​(T o)
        Returns:
        whether the given object is mapped by this mapping
      • getMaximumIndex

        int getMaximumIndex()
        Returns:
        the maximum integer mapped to an object
      • getSize

        int getSize()
        Returns:
        the current size of the bijection
      • add

        int add​(T o)
        Add an Object to the set of mapped objects.
        Returns:
        the integer to which the object is mapped.