Class InterleavedIndexHopMap


  • public final class InterleavedIndexHopMap
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()  
      int get​(java.lang.Object k)  
      int intern​(java.lang.Object k)
      Puts k in the map (if not present) and assigns and returns the index associated with it assigns ints monotonically from 0
      boolean isEmpty()  
      static void main​(java.lang.String[] args)  
      int oldIndex​(java.lang.Object k)
      Puts k in the map if it was not already present.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • InterleavedIndexHopMap

        public InterleavedIndexHopMap()
      • InterleavedIndexHopMap

        public InterleavedIndexHopMap​(int capacity)
    • Method Detail

      • clear

        public void clear()
      • get

        public int get​(java.lang.Object k)
        Parameters:
        k - , non-null
        Returns:
        the integer associated with k, or -1 if not present
      • oldIndex

        public int oldIndex​(java.lang.Object k)
        Puts k in the map if it was not already present. Returns -1 if k was freshly added Returns k's index if k was already in the map.
        Parameters:
        k - , non-null
        Returns:
        the integer associated with k or -1
      • isEmpty

        public boolean isEmpty()
      • intern

        public int intern​(java.lang.Object k)
        Puts k in the map (if not present) and assigns and returns the index associated with it assigns ints monotonically from 0
        Parameters:
        k - , non-null
        Returns:
        the integer associated with k
      • main

        public static void main​(java.lang.String[] args)