net.wangs.xmlutil
Class MultiKeyHashtable

java.lang.Object
  extended bynet.wangs.xmlutil.MultiKeyHashtable

public class MultiKeyHashtable
extends java.lang.Object

This hashtable stores values using string array.

Author:
Yuqing Wang, Christian Kölle

Field Summary
protected static java.lang.String _hashToken
           
protected  java.util.Hashtable _map
           
 
Constructor Summary
MultiKeyHashtable()
           
 
Method Summary
protected  java.lang.String _composeHashKey(java.lang.String[] keys)
          Given a String array, compose a String value that follows the style of hashkey used in getNodeValuesHashedByNamedAttrs().
protected  java.lang.String[] _decomposeHashKey(java.lang.String keys)
          Given a String, create a string array with the keys as elements
 java.lang.Object get(java.lang.String[] keys)
          This method retrieves the value at String array keys.
 java.util.Set keySet()
          Returns an enumeration with the keys.
 void put(java.lang.String[] keys, java.lang.Object value)
          This method stores the value at String array keys.
 void putAll(MultiKeyHashtable pHash)
          Copies all of the mappings from the specified MultiKeyHashtable to this MultiKeyHashtable.
 void reset()
          Reset contents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_hashToken

protected static final java.lang.String _hashToken
See Also:
Constant Field Values

_map

protected final java.util.Hashtable _map
Constructor Detail

MultiKeyHashtable

public MultiKeyHashtable()
Method Detail

get

public java.lang.Object get(java.lang.String[] keys)
This method retrieves the value at String array keys.

Parameters:
keys - - String array, must not be null
Returns:
Object the value or null if not found
Throws:
java.lang.NullPointerException - thrown if keys are null

put

public void put(java.lang.String[] keys,
                java.lang.Object value)
This method stores the value at String array keys.

Parameters:
keys - - must not be null
value -
Throws:
java.lang.NullPointerException - thrown if key1 or key2 are null

putAll

public void putAll(MultiKeyHashtable pHash)
Copies all of the mappings from the specified MultiKeyHashtable to this MultiKeyHashtable. These mappings will replace any mappings that this MultiKeyHashtable had for any of the keys currently in the specified MultiKeyHashtable.

Parameters:
pHash - The MultiKeyHashtable to be copied.

reset

public void reset()
Reset contents. Equals to Map::clear().


keySet

public java.util.Set keySet()
Returns an enumeration with the keys.

Returns:
The keys in an Enumeration

_composeHashKey

protected java.lang.String _composeHashKey(java.lang.String[] keys)
Given a String array, compose a String value that follows the style of hashkey used in getNodeValuesHashedByNamedAttrs().


_decomposeHashKey

protected java.lang.String[] _decomposeHashKey(java.lang.String keys)
Given a String, create a string array with the keys as elements



Copyright © 2005 . All Rights Reserved.