|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.thdl.util.Trie
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()
Constructs a trie. |
Method Summary | |
Object |
get(String key)
Gets an object that matches the key. |
boolean |
hasPrefix(String key)
Returns true if and only if key is a prefix of another, distinct member of the trie. |
Object |
put(String key,
Object value)
Puts 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 |
public static final int ALPHA_SIZE
Constructor Detail |
public Trie()
Method Detail |
public Object put(String key, Object value)
key
- must be a 7-bit ASCII stringvalue
- any java object, but not null.
NullPointerException
- if value is null or if key is nullpublic Object get(String key)
key
- must be a 7-bit ASCII string
public boolean hasPrefix(String key)
key
- must be a 7-bit ASCII string
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |