gzz.util
Class AbstractFlatHashMap
java.lang.Object
|
+--gzz.util.AbstractHashMap
|
+--gzz.util.AbstractFlatHashMap
- All Implemented Interfaces:
- java.util.Map
- Direct Known Subclasses:
- SecondaryHashMap
- public abstract class AbstractFlatHashMap
- extends AbstractHashMap
A flat hash class.
Because of the Java overheads associated with objects,
we can afford to make a flat hashtable (which does NOT have
the overhead of an object per entry) large enough to more
than cover the difference. This is especially so on Kaffe,
where the overhead associated with object creation is considerable.
However, there is one considerable downside: Java always checks
the array bounds on array access, which means that while creating
a new entry is fast, putting a new value into an existing entry
or accessing entries can actually be slower (and is, according
to benchmarks).
Method Summary |
java.util.Set |
keySet()
|
protected void |
resize(int nsize,
int nentrylimit)
|
int |
size()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Map |
get, put |
AbstractFlatHashMap
public AbstractFlatHashMap()
resize
protected void resize(int nsize,
int nentrylimit)
size
public int size()
keySet
public java.util.Set keySet()