A Ternary Trie String lookup data structure.
This Trie is of a fixed size and cannot grow (which can be a good thing with regards to DOS when used as a cache).
The Trie is stored in 3 arrays:
char _treeThis is semantically 2 dimensional array flattened into a 1 dimensional char array. The second dimension
is that every 4 sequential elements represents a row of: character; hi index; eq index; low index, used to build a
ternary trie of key strings.
String _keyAn array of key values where each element matches a row in the _tree array. A non zero key element
indicates that the _tree row is a complete key rather than an intermediate character of a longer key.
V _valueAn array of values corresponding to the _key array
The lookup of a value will iterate through the _tree array matching characters. If the equal tree branch is followed,
then the _key array is looked up to see if this is a complete match. If a match is found then the _value array is looked up
to return the matching value.
This Trie may be instantiated either as case sensitive or insensitive.
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.