| java.lang.Object org.apache.xerces.util.SymbolHash
SymbolHash | public class SymbolHash (Code) | | This class is an unsynchronized hash table primary used for String
to Object mapping.
The hash code uses the same algorithm as SymbolTable class.
author: Elena Litani version: $Id: SymbolHash.java 447241 2006-09-18 05:12:57Z mrglavas $ |
Inner Class :final protected static class Entry | |
Field Summary | |
protected Entry[] | fBuckets Buckets. | protected int | fNum Number of elements. | protected int | fTableSize Default table size. |
Constructor Summary | |
public | SymbolHash() Constructs a key table with the default size. | public | SymbolHash(int size) Constructs a key table with a given size. |
Method Summary | |
public void | clear() Remove all key/value assocaition. | public Object | get(Object key) Get the value associated with the given key. | public int | getLength() Get the number of key/value pairs stored in this table. | public int | getValues(Object[] elements, int from) Add all values to the given array. | public SymbolHash | makeClone() Make a clone of this object. | public void | put(Object key, Object value) Adds the key/value mapping to the key table. | protected Entry | search(Object key, int bucket) |
fBuckets | protected Entry[] fBuckets(Code) | | Buckets.
|
fNum | protected int fNum(Code) | | Number of elements.
|
fTableSize | protected int fTableSize(Code) | | Default table size.
|
SymbolHash | public SymbolHash()(Code) | | Constructs a key table with the default size.
|
SymbolHash | public SymbolHash(int size)(Code) | | Constructs a key table with a given size.
Parameters: size - the size of the key table. |
clear | public void clear()(Code) | | Remove all key/value assocaition. This tries to save a bit of GC'ing
by at least keeping the fBuckets array around.
|
get | public Object get(Object key)(Code) | | Get the value associated with the given key.
Parameters: key - the value associated with the given key. |
getLength | public int getLength()(Code) | | Get the number of key/value pairs stored in this table.
the number of key/value pairs stored in this table. |
getValues | public int getValues(Object[] elements, int from)(Code) | | Add all values to the given array. The array must have enough entry.
Parameters: elements - the array to store the elements Parameters: from - where to start store element in the array number of elements copied to the array |
put | public void put(Object key, Object value)(Code) | | Adds the key/value mapping to the key table. If the key already exists,
the previous value associated with this key is overwritten by the new
value.
Parameters: key - Parameters: value - |
|
|