uka.util
Class Long2ObjectHashtable
java.lang.Object
uka.util.Long2ObjectHashtable
- public class Long2ObjectHashtable
- extends java.lang.Object
Implements a Hashtable similar to java.util.Hashtable, but always
maps long keys to Object values. This allows a much more
efficient implementation.
The code is based on GJ's Hashtable implementation.
- Author:
- Jürgen Reuter
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
hashSize
private int hashSize
hashMask
private int hashMask
limit
private int limit
size
private int size
table
private Long2ObjectHashtable.Entry[] table
spare
private Long2ObjectHashtable.Entry spare
- Keep unused entries for later reuse here.
Long2ObjectHashtable
public Long2ObjectHashtable(int initialSize,
float fillFactor)
Long2ObjectHashtable
public Long2ObjectHashtable(int initialSize)
Long2ObjectHashtable
public Long2ObjectHashtable()
make
public static Long2ObjectHashtable make()
dble
private void dble()
getIndex
private final int getIndex(long key)
copy
private void copy(Long2ObjectHashtable.Entry e)
get
public java.lang.Object get(long key)
- Return value for key or null, if key not found.
put
public java.lang.Object put(long key,
java.lang.Object value)
- Put (key, value) pair into map. Remove (key, *), if (value ==
null).
- Returns:
- old value associated with key, or null, if key was not
present before.
remove
public void remove(long key)
size
public int size()
reset
public void reset()