java.lang.Object
org.apache.jena.ext.xerces.util.SymbolHash
This class is an unsynchronized hash table primary used for String
to Object mapping.
The hash code uses the same algorithm as SymbolTable class.
- Version:
- $Id: SymbolHash.java 819653 2009-09-28 17:29:56Z knoaman $
- Author:
- Elena Litani
-
Constructor Summary
ConstructorDescriptionConstructs a key table with the default size.SymbolHash
(int size) Constructs a key table with a given size. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Remove all key/value assocaition.Get the value associated with the given key.Object[]
Return key/value pairs of all entries in the mapint
Get the number of key/value pairs stored in this table.int
Add all values to the given array.Make a clone of this object.void
Adds the key/value mapping to the key table.
-
Constructor Details
-
SymbolHash
public SymbolHash()Constructs a key table with the default size. -
SymbolHash
public SymbolHash(int size) Constructs a key table with a given size.- Parameters:
size
- the size of the key table.
-
-
Method Details
-
put
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
-value
-
-
get
Get the value associated with the given key.- Parameters:
key
-- Returns:
- the value associated with the given key.
-
getLength
public int getLength()Get the number of key/value pairs stored in this table.- Returns:
- the number of key/value pairs stored in this table.
-
getValues
Add all values to the given array. The array must have enough entry.- Parameters:
elements
- the array to store the elementsfrom
- where to start store element in the array- Returns:
- number of elements copied to the array
-
getEntries
Return key/value pairs of all entries in the map -
makeClone
Make a clone of this object. -
clear
public void clear()Remove all key/value assocaition. This tries to save a bit of GC'ing by at least keeping the fBuckets array around.
-