Package org.fressian.impl
Class InterleavedIndexHopMap
- java.lang.Object
-
- org.fressian.impl.InterleavedIndexHopMap
-
public final class InterleavedIndexHopMap extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description InterleavedIndexHopMap()
InterleavedIndexHopMap(int capacity)
-
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 0boolean
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.
-
-
-
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)
-
-