Package org.apache.uima.internal.util
Class Int2IntHashMap
java.lang.Object
org.apache.uima.internal.util.Int2IntHashMap
A map<int, int>
based on JCasHashMap, but without the multi-threading support
This impl is for use in a single thread case only
Supports shrinking (reallocating the big table)
Implements Map - like interface:
keys and values are ints
Entry set not (yet) impl
keys must be non-0; 0 is reserved to be an empty slot
values can be anything, but 0 is the value returned by get if not found so
values probably should not be 0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
boolean
containsKey
(int key) int
get
(int key) int[]
boolean
isKeyValid
(int position) keyIterator
(int aKey) keyValueIterator
(int aKey) int
put
(int key, int value) void
putInner
(int key, int value) void
int
size()
-
Constructor Details
-
Int2IntHashMap
public Int2IntHashMap() -
Int2IntHashMap
public Int2IntHashMap(int initialCapacity)
-
-
Method Details
-
clear
public void clear() -
get
public int get(int key) -
containsKey
public boolean containsKey(int key) -
isKeyValid
public boolean isKeyValid(int position) -
put
public int put(int key, int value) -
putInner
public void putInner(int key, int value) -
size
public int size() -
getSortedKeys
public int[] getSortedKeys() -
keyIterator
-
keyIterator
-
keyValueIterator
-
keyValueIterator
-
showHistogram
public void showHistogram()
-