org.apache.xml.utils
Class Trie

java.lang.Object
  extended byorg.apache.xml.utils.Trie

public class Trie
extends Object

A digital search trie for 7-bit ASCII text The API is a subset of java.util.Hashtable The key must be a 7-bit ASCII string The value may be any Java Object


Nested Class Summary
(package private)  class Trie.Node
           The node representation for the trie.
 
Field Summary
static int ALPHA_SIZE
          Size of the m_nextChar array.
(package private)  Trie.Node m_Root
          The root node of the tree.
 
Constructor Summary
Trie()
          Construct the trie.
 
Method Summary
 Object get(String key)
          Get an object that matches the key.
 Object put(String key, Object value)
          Put an object into the trie for lookup.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALPHA_SIZE

public static final int ALPHA_SIZE
Size of the m_nextChar array.

See Also:
Constant Field Values

m_Root

Trie.Node m_Root
The root node of the tree.

Constructor Detail

Trie

public Trie()
Construct the trie.

Method Detail

put

public Object put(String key,
                  Object value)
Put an object into the trie for lookup.

Parameters:
key - must be a 7-bit ASCII string
value - any java object.
Returns:
The old object that matched key, or null.

get

public Object get(String key)
Get an object that matches the key.

Parameters:
key - must be a 7-bit ASCII string
Returns:
The object that matches the key, or null.