|
Jacson | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.spieleck.util.IntMap
public class IntMap
The IntMap provides a simple hashmap from keys to integers. The API is simplified of the HashMap/Hashtable collection API. Additionally there are call to do simple arithmetic with entries in the map.
The convenience of IntMap is avoiding all wrapping of integers.
Note: This class is completely unsynchronized for speed!
Field Summary | |
---|---|
protected java.lang.Object[] |
keys
|
protected int |
limit
|
protected int |
mask
|
static int |
NULL
Encoding of a null entry. |
protected int |
nullValue
|
protected int |
size
|
protected int[] |
values
|
Constructor Summary | |
---|---|
IntMap()
Create a new IntMap. |
|
IntMap(int size)
|
|
IntMap(int size,
int nullValue)
|
Method Summary | |
---|---|
int |
add(java.lang.Object key,
int off)
Optimized operations. |
void |
clear()
Clear the hashmap. |
int |
dec(java.lang.Object key)
Optimized operations. |
protected int |
firstIndex(java.lang.Object key)
This only works with binary indizes |
int |
get(java.lang.Object key)
Get an Element |
int |
getElement(java.lang.Object key)
Get an Element |
int |
getNullValue()
|
protected void |
grow()
Expands the table |
int |
inc(java.lang.Object key)
Optimized operations. |
protected int |
internalPut(java.lang.Object key,
int value)
|
java.util.Iterator |
iterator()
|
java.util.Enumeration |
keys()
|
protected int |
nextIndex(int index)
|
int |
put(java.lang.Object key,
int value)
|
int |
putElement(java.lang.Object key,
int value)
Puts a new value in the property table with the appropriate flags |
int |
remove(java.lang.Object key)
Deletes the entry. |
int |
size()
Returns the current number of entries in the map. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int NULL
protected java.lang.Object[] keys
protected int nullValue
protected int[] values
protected int size
protected int mask
protected int limit
Constructor Detail |
---|
public IntMap()
public IntMap(int size)
public IntMap(int size, int nullValue)
Method Detail |
---|
public int getNullValue()
protected int firstIndex(java.lang.Object key)
protected int nextIndex(int index)
public void clear()
public int size()
public int getElement(java.lang.Object key)
public int get(java.lang.Object key)
public int inc(java.lang.Object key)
public int dec(java.lang.Object key)
public int add(java.lang.Object key, int off)
protected void grow()
public int putElement(java.lang.Object key, int value)
public int put(java.lang.Object key, int value)
protected int internalPut(java.lang.Object key, int value)
public int remove(java.lang.Object key)
public java.util.Enumeration keys()
public java.util.Iterator iterator()
public java.lang.String toString()
toString
in class java.lang.Object
|
spieleck.de | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |