shared
Class StringMap
java.lang.Object
|
+--shared.StringMap
- public class StringMap
- extends java.lang.Object
StringMap implements a general mapping/lookup class for strings. The strings
may be mapped to any data type Elem. The mapping is accomplished using both a
hash table and an array. The hash table is provided for speedy searches, and
the array is provided for iteration.
|
Constructor Summary |
StringMap(int sizeHint)
Constructor. |
|
Method Summary |
boolean |
get(java.lang.String name,
OptionAccess value)
Retrieves a mapping given the name and a reference in which to store the value. |
void |
map(java.lang.String name,
OptionAccess value)
Sets the mapping for an item, adding the mapping if the item is not currently in
the table. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
StringMap
public StringMap(int sizeHint)
- Constructor. The default constructor allows an optional parameter for an
estimated size of the hash table.
- Parameters:
sizeHint - The size of the hashtable.
map
public void map(java.lang.String name,
OptionAccess value)
- Sets the mapping for an item, adding the mapping if the item is not currently in
the table.
- Parameters:
name - The name to be mapped.value - The value to be mapped to.
get
public boolean get(java.lang.String name,
OptionAccess value)
- Retrieves a mapping given the name and a reference in which to store the value.
Returns TRUE if the mapping exists, false if it does not. No value is placed in
the value reference if the mapping does not exist.
- Parameters:
name - Name being mapped.value - The value to be found.- Returns:
- TRUE if the mapping exists, FALSE if it does not.