org.apache.xml.utils

Class Trie


public class Trie
extends java.lang.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

Field Summary

static int
ALPHA_SIZE
Size of the m_nextChar array.

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.

Field Details

ALPHA_SIZE

public static final int ALPHA_SIZE
Size of the m_nextChar array.
Field Value:
128

Constructor Details

Trie

public Trie()
Construct the trie.

Method Details

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.

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.

Copyright B) 2004 Apache XML Project. All Rights Reserved.