public class StringTrie<E> extends Object
| Modifier and Type | Class and Description |
|---|---|
protected class |
StringTrie.TrieEdge
Our Edge class is one node in the StringTrieEdge graph.
|
| Modifier and Type | Field and Description |
|---|---|
protected StringTrie.TrieEdge |
root |
| Constructor and Description |
|---|
StringTrie() |
| Modifier and Type | Method and Description |
|---|---|
void |
compress(CharPoolTrie charPoolTrie) |
protected void |
doPut(StringTrie.TrieEdge into,
char[] key,
int index,
int end,
E value) |
Iterable<StringTrie.TrieEdge> |
findPrefixed(String prefix) |
E |
get(char[] key) |
E |
get(char[] key,
int pos,
int end) |
E |
get(Chars keys,
int pos,
int end) |
E |
get(String key) |
protected void |
lock(StringTrie.TrieEdge into,
boolean ownsParent) |
protected StringTrie.TrieEdge |
newEdgeGreater(StringTrie.TrieEdge previous,
int keyMax,
char[] existing,
int matchesTo,
char[] key,
int keyIndex,
int keyEnd,
E value) |
protected StringTrie.TrieEdge |
newEdgeLesser(StringTrie.TrieEdge previous,
int keyMax,
char[] existing,
int matchesTo,
char[] key,
int keyIndex,
int keyEnd,
E value) |
protected E |
onEmpty(StringTrie.TrieEdge e,
Chars keys,
int pos,
int end) |
void |
put(char[] key,
int start,
int end,
E value) |
void |
put(String key,
E value) |
protected E |
returnValue(StringTrie.TrieEdge e,
Chars keys,
int pos,
int end) |
String |
toString() |
protected void |
unlock(StringTrie.TrieEdge into,
boolean ownsParent) |
protected final StringTrie.TrieEdge root
public void put(char[] key,
int start,
int end,
E value)
protected void doPut(StringTrie.TrieEdge into, char[] key, int index, int end, E value)
protected StringTrie.TrieEdge newEdgeLesser(StringTrie.TrieEdge previous, int keyMax, char[] existing, int matchesTo, char[] key, int keyIndex, int keyEnd, E value)
protected StringTrie.TrieEdge newEdgeGreater(StringTrie.TrieEdge previous, int keyMax, char[] existing, int matchesTo, char[] key, int keyIndex, int keyEnd, E value)
protected void lock(StringTrie.TrieEdge into, boolean ownsParent)
into - - The edge to lockownsParent - - Whether we already own an explicit lock on the parent.protected void unlock(StringTrie.TrieEdge into, boolean ownsParent)
into - - The edge to lockownsParent - - If true, you are already synchronized on into.cursor - - Whatever object you returned when you locked. This method
is a stub for more sophisticated subclasses of StringTrie, which may need
to perform proper concurrent locking, or event dispatch. It is called in
the finally block of whatever code ran
StringTrie#lock(StringTrieEdge, boolean). If you use Edge into.wait(0, nanos)
in lock(), now would be a great time to call into into.notify() :)public E get(char[] key)
public E get(char[] key, int pos, int end)
public Iterable<StringTrie.TrieEdge> findPrefixed(String prefix)
public void compress(CharPoolTrie charPoolTrie)
protected E returnValue(StringTrie.TrieEdge e, Chars keys, int pos, int end)
protected E onEmpty(StringTrie.TrieEdge e, Chars keys, int pos, int end)
Copyright © December 07, 2012–2015 The Internet Party. All rights reserved.