ArrayTrie

<p>A Trie string lookup data structure using a fixed size array.</p> <p>This implementation is always case insensitive and is optimal for a small number of fixed strings with few special characters. The Trie is stored in an array of lookup tables, each indexed by the next character of the key. Frequently used characters are directly indexed in each lookup table, whilst infrequently used characters must use a big character table. </p> <p>This Trie is very space efficient if the key characters are from ' ', '+', '-', ':', ';', '.', 'A' to 'Z' or 'a' to 'z'. Other ISO-8859-1 characters can be used by the key, but less space efficiently. </p> <p>This Trie is not Threadsafe and contains no mutual exclusion or deliberate memory barriers. It is intended for an ArrayTrie to be built by a single thread and then used concurrently by multiple threads and not mutated during that access. If concurrent mutations of the Trie is required external locks need to be applied. </p>

@param (V) the element of entry

Constructors

this
this()
Undocumented in source.
this
this(int capacity)

@param capacity The capacity of the trie, which at the worst case is the total number of characters of all keys stored in the Trie. The capacity needed is dependent of the shared prefixes of the keys. For example, a capacity of 6 nodes is required to store keys "foo" and "bar", but a capacity of only 4 is required to store "bar" and "bat".

Members

Functions

clear
void clear()
Undocumented in source. Be warned that the author may not have intended to support it.
get
V get(string s, int offset, int len)
Undocumented in source. Be warned that the author may not have intended to support it.
get
V get(ByteBuffer b, int offset, int len)
Undocumented in source. Be warned that the author may not have intended to support it.
getBest
V getBest(byte[] b, int offset, int len)
Undocumented in source. Be warned that the author may not have intended to support it.
getBest
V getBest(ByteBuffer b, int offset, int len)
Undocumented in source. Be warned that the author may not have intended to support it.
getBest
V getBest(string s, int offset, int len)
Undocumented in source. Be warned that the author may not have intended to support it.
isFull
bool isFull()
Undocumented in source. Be warned that the author may not have intended to support it.
keySet
Set!(string) keySet()
Undocumented in source. Be warned that the author may not have intended to support it.
put
bool put(string s, V v)
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta