Class InterleavedIndexHopMap

java.lang.Object
org.fressian.impl.InterleavedIndexHopMap

public final class InterleavedIndexHopMap extends Object
  • Constructor Details

    • InterleavedIndexHopMap

      public InterleavedIndexHopMap()
    • InterleavedIndexHopMap

      public InterleavedIndexHopMap(int capacity)
  • Method Details

    • clear

      public void clear()
    • get

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

      public int oldIndex(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(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(String[] args)