- java.lang.Object
-
- com.ibm.dtfj.corereaders.zos.util.AbstractHashMap
-
- com.ibm.dtfj.corereaders.zos.util.IntegerMap
-
- All Implemented Interfaces:
Serializable
public final class IntegerMap extends AbstractHashMap
This is a simple class to map one integer to another but without the overhead of using a Hashtable. There is one limitation at present which is that the value of -1 can't be used since this is currently used to indicate value not found.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description IntegerMap()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
get(long key)
Returns the value mapped by the given key.static void
main(String[] args)
Run some basic tests on this class.int
memoryUsage()
void
put(long key, long value)
Add the key/value pair to the map.long
remove(long key)
Remove the key from the map and return the old value.-
Methods declared in class com.ibm.dtfj.corereaders.zos.util.AbstractHashMap
getKeys, getKeysArray
-
-
-
-
Method Detail
-
get
public long get(long key)
Returns the value mapped by the given key.- Returns:
- the value or -1 if it cannot be found
-
put
public void put(long key, long value)
Add the key/value pair to the map. The value must not be -1.
-
remove
public long remove(long key)
Remove the key from the map and return the old value.
-
memoryUsage
public int memoryUsage()
-
main
public static void main(String[] args)
Run some basic tests on this class.
-
-