|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.crimson.parser.SimpleHashtable
This class implements a special purpose hashtable. It works like a
normal java.util.Hashtable
except that:
The overall result is that it's less expensive to use these in
performance-critical locations, in terms both of CPU and memory,
than java.util.Hashtable
instances. In this package
it makes a significant difference when normalizing attributes,
which is done for each start-element construct.
Nested Class Summary | |
private static class |
SimpleHashtable.Entry
Hashtable collision list. |
Field Summary | |
private int |
count
|
private SimpleHashtable.Entry |
current
|
private int |
currentBucket
|
private static float |
loadFactor
|
private SimpleHashtable.Entry[] |
table
|
private int |
threshold
|
Constructor Summary | |
SimpleHashtable()
Constructs a new, empty hashtable with a default capacity. |
|
SimpleHashtable(int initialCapacity)
Constructs a new, empty hashtable with the specified initial capacity. |
Method Summary | |
void |
clear()
|
Object |
get(String key)
Returns the value to which the specified key is mapped in this hashtable. |
Object |
getNonInterned(String key)
Returns the value to which the specified key is mapped in this hashtable ... the key isn't necessarily interned, though. |
boolean |
hasMoreElements()
Used to view this as an enumeration; returns true if there are more keys to be enumerated. |
Enumeration |
keys()
Returns an enumeration of the keys in this hashtable. |
Object |
nextElement()
Used to view this as an enumeration; returns the next key in the enumeration. |
Object |
put(Object key,
Object value)
Maps the specified key to the specified
value in this hashtable. |
private void |
rehash()
Increases the capacity of and internally reorganizes this hashtable, in order to accommodate and access its entries more efficiently. |
int |
size()
Returns the number of keys in this hashtable. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private SimpleHashtable.Entry[] table
private SimpleHashtable.Entry current
private int currentBucket
private int count
private int threshold
private static final float loadFactor
Constructor Detail |
public SimpleHashtable(int initialCapacity)
initialCapacity
- the initial capacity of the hashtable.public SimpleHashtable()
Method Detail |
public void clear()
public int size()
public Enumeration keys()
Enumeration
public boolean hasMoreElements()
hasMoreElements
in interface Enumeration
true
if and only if this enumeration object
contains at least one more element to provide;
false
otherwise.public Object nextElement()
nextElement
in interface Enumeration
public Object get(String key)
public Object getNonInterned(String key)
private void rehash()
public Object put(Object key, Object value)
key
to the specified
value
in this hashtable. Neither the key nor the
value can be null
.
The value can be retrieved by calling the get
method
with a key that is equal to the original key.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |