This implementation is always case insensitive and is optimal for a variable number of fixed strings with few special characters.
This Trie is stored in a Tree and is unlimited in capacity
This Trie is not Threadsafe and contains no mutual exclusion or deliberate memory barriers. It is intended for an TreeTrie 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.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final int[] | |
| private final TreeTrie. | |
| private static final int | |
| private static final int[] | |
| private static final int[] |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public static < The value type of the Trie V> AbstractTrie | |
| public V | get(String
The key s, int The offset within the string of the key offset, int the length of the key len)Implements org. Get an exact match from a String key |
| public V | get(ByteBuffer
The buffer b, int The offset within the buffer of the key offset, int the length of the key len)Implements org. Get an exact match from a segment of a ByteBuffer as key |
| public V | getBest(byte[]
The buffer b, int The offset within the array of the key offset, int the length of the key len)Overrides org. Implements org. Get the best match from key in a byte array. |
| private V | |
| public V | getBest(String
The string s, int The offset within the string of the key offset, int the length of the key len)Implements org. Get the best match from key in a String. |
| private V | |
| public V | getBest(ByteBuffer
The buffer b, int The offset within the buffer of the key offset, int the length of the key len)Implements org. Get the best match from key in a byte buffer. |
| private V | |
| public boolean | |
| private boolean | |
| public Set | keySet()
Implements org. Get a |
| private static <V> void | |
| public boolean | put(String
The key for the entry. Must be non null, but can be empty. s, V The value of the entry. Must be non null. v)Implements org. Put an entry into the index. |
| public int | |
| public String | |
| private static <V> void |
| _lookup | back to summary |
|---|---|
| private final int[] _lookup | |
| _root | back to summary |
|---|---|
| private final TreeTrie. | |
| INDEX | back to summary |
|---|---|
| private static final int INDEX | |
| LOOKUP_INSENSITIVE | back to summary |
|---|---|
| private static final int[] LOOKUP_INSENSITIVE | |
| LOOKUP_SENSITIVE | back to summary |
|---|---|
| private static final int[] LOOKUP_SENSITIVE | |
| TreeTrie | back to summary |
|---|---|
pack-priv TreeTrie()
| |
| TreeTrie | back to summary |
|---|---|
| pack-priv TreeTrie(boolean caseSensitive) | |
| clear | back to summary |
|---|---|
| public void clear() Implements org. Doc from org. Remove all entries from the index.
| |
| from | back to summary |
|---|---|
| public static <V> AbstractTrie Create a trie from capacity and content
| |
| get | back to summary |
|---|---|
| public V get(String s, int offset, int len) Implements org. Doc from org. Get an exact match from a String key | |
| get | back to summary |
|---|---|
| public V get(ByteBuffer b, int offset, int len) Implements org. Doc from org. Get an exact match from a segment of a ByteBuffer as key
| |
| getBest | back to summary |
|---|---|
| public V getBest(byte[] b, int offset, int len) Overrides org. Implements org. Doc from org. Get the best match from key in a byte array. The key is assumed to by ISO_8859_1 characters.
| |
| getBest | back to summary |
|---|---|
| private V getBest(TreeTrie. | |
| getBest | back to summary |
|---|---|
| public V getBest(String s, int offset, int len) Implements org. Doc from org. Get the best match from key in a String. | |
| getBest | back to summary |
|---|---|
| private V getBest(TreeTrie. | |
| getBest | back to summary |
|---|---|
| public V getBest(ByteBuffer b, int offset, int len) Implements org. Doc from org. Get the best match from key in a byte buffer. The key is assumed to by ISO_8859_1 characters.
| |
| getBest | back to summary |
|---|---|
| private V getBest(TreeTrie. | |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Implements org. Doc from org. Check if the index contains any entry.
| |
| isEmpty | back to summary |
|---|---|
| private boolean isEmpty(TreeTrie. | |
| keySet | back to summary |
|---|---|
| public Set Implements org. Doc from org. Get a | |
| keySet | back to summary |
|---|---|
| private static <V> void keySet(Set<String> set, TreeTrie. | |
| put | back to summary |
|---|---|
| public boolean put(String s, V v) Implements org. Doc from org. Put an entry into the index. | |
| size | back to summary |
|---|---|
| public int size() Implements org. Doc from org. Get the number of entries in the index.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| toString | back to summary |
|---|---|
| private static <V> void toString(Appendable out, TreeTrie. | |
| Modifier and Type | Field and Description |
|---|---|
| private final char | |
| private String | |
| private final TreeTrie. | |
| private final List | |
| private V |
| Access | Constructor and Description |
|---|---|
| private |
| _c | back to summary |
|---|---|
| private final char _c | |
| _key | back to summary |
|---|---|
| private String _key | |
| _nextIndex | back to summary |
|---|---|
| private final TreeTrie. | |
| _nextOther | back to summary |
|---|---|
| private final List<TreeTrie. | |
| _value | back to summary |
|---|---|
| private V _value | |
| Node | back to summary |
|---|---|
private Node(char c)
| |