|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.samskivert.util.CheapIntMap
public class CheapIntMap
A low overhead hash map using positive integers as keys that is useful for fast storage and lookup of a small and bounded number of items.
| Field Summary | |
|---|---|
protected int[] |
_keys
|
protected Object[] |
_values
|
| Constructor Summary | |
|---|---|
CheapIntMap(int maxSize)
Constructs a map that can hold the specified number of items. |
|
| Method Summary | |
|---|---|
void |
clear()
Clears out all mappings from the table. |
Object |
get(int key)
Returns the object with the specified key, null if no object exists in the table with that key. |
int |
getKey(int index)
Returns the key with the specified index or -1 if no key exists at that index. |
Object |
getValue(int index)
Returns the value with the specified index or null if no value exists at that index. |
void |
put(int key,
Object value)
Inserts the specified value into the map. |
Object |
remove(int key)
Removes the mapping associated with the specified key. |
int |
size()
Returns the number of mappings in this table. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int[] _keys
protected Object[] _values
| Constructor Detail |
|---|
public CheapIntMap(int maxSize)
| Method Detail |
|---|
public void put(int key,
Object value)
public Object get(int key)
public Object remove(int key)
public void clear()
public int size()
public int getKey(int index)
public Object getValue(int index)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||