Class ObjectIntMapper<E>


  • public class ObjectIntMapper<E>
    extends Object
    Gives an injection of Objects to ints. Different instances may map different ints to the same object.
    • Constructor Detail

      • ObjectIntMapper

        public ObjectIntMapper()
      • ObjectIntMapper

        public ObjectIntMapper​(FlowUniverse<E> flowUniverse)
      • ObjectIntMapper

        public ObjectIntMapper​(Collection<E> collection)
    • Method Detail

      • add

        public int add​(E o)
        adds o into the map. no test are made, if it is already in the map.
      • getInt

        public int getInt​(E o)
        returns the mapping of o. if there has been a call to objectToInt with the same o before, the same value will be returned.
        Parameters:
        o -
        Returns:
        o's mapping
      • getObject

        public E getObject​(int i)
        returns the object associated to i.
        Parameters:
        i -
        Returns:
        i's object
      • contains

        public boolean contains​(Object o)
        returns true, if o has already been mapped.
        Parameters:
        o -
        Returns:
        true if o has already a number.
      • size

        public int size()
        returns the number of mapped objects.