A
Radix Trie;
used to store lists of hierarchically-named signals and
efficiently detect the separator character.
A RadixTrie consists of a tree of nodes; each path from the root
to a node with entry!=null constitutes an entry. The
concatenation of all TreeMap keys along the path is the key and
the entry value is the entry. So you might think of a RadixTrie
as a Map
which has excellent space efficiency when the
keys share large prefixes.
An additional feature in this implementation (not normally
included in RadixTries) is the tracking of each character's
"score". The score of a branch is defined to be the number of
descendents it has with entry!=null. The score of a node is the
*second largest* score among its branches. The score of a
character "c" is the sum of the scores of all nodes "n" such that
the last charachter of its key (in its parent's TreeMap) is "c".
The character with the highest score is a very good guess at the
"hierarchy separator"; it is the character which is most likely to
terminate the longest common prefix of a family of strings.