public class ConsecutiveMap
extends Object
| Modifier and Type | Field and Description |
|---|---|
private Vector |
inOrder
Vector of all unique keys, in order of addition
|
private HashMap |
map
Mapping used to keep the unique set of keys
|
| Constructor and Description |
|---|
ConsecutiveMap() |
| Modifier and Type | Method and Description |
|---|---|
int |
get(Object key)
Retrieve the namecode for the given key.
|
Object[] |
getArray()
Retrieve an array of all the keys, ordered by consecutive number.
|
boolean |
has(Object key)
Check if the given key is present in the map yet.
|
int |
put(Object key)
If the key is already present in the map, return its assigned number.
|
private HashMap map
private Vector inOrder
public int put(Object key)
key - The key to look uppublic int get(Object key)
public boolean has(Object key)
public Object[] getArray()