Provides some common implementations, which may not be the most efficient. For byte operations, the assumption is made that the charset is ISO-8859-1
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final boolean |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public V | get(String
The key s)Implements org. Get an exact match from a String key |
| public V | get(ByteBuffer
The buffer b)Implements org. Get an exact match from a segment of a ByteBuffer as key |
| public V | getBest(String
The string s)Implements org. Get the best match from key in a String, which may be a prefix match or an exact match. |
| public V | getBest(byte[]
The buffer b, int The offset within the array of the key offset, int the length of the key len)Implements org. Get the best match from key in a byte array. |
| public boolean | |
| public boolean | |
| public boolean | put(V
The value and key v)Implements org. Put a value as both a key and a value. |
| protected boolean | |
| public V | remove(String
The key for the entry s)Implements org. Remove an entry from the index. |
| protected static int | Returns: The capacity in nodes of a tree decompositionThe keys to be put in a Trie keys, boolean true if the capacity should be calculated with case-sensitive keys caseSensitive)Calculate required Trie capacity in nodes of a tree decomposition of the keys. |
| private static int | Returns: The capacity in tree nodes of the substreeThe keys to calculate the capacity for keys, int The offset of the first key to be considered offset, int The number of keys to be considered length, int The character to be considered index)Calculate required Trie capacity in nodes of a sub-tree decomposition of the keys. |
| _caseSensitive | back to summary |
|---|---|
| pack-priv final boolean _caseSensitive | |
| AbstractTrie | back to summary |
|---|---|
| protected AbstractTrie(boolean caseSensitive) | |
| get | back to summary |
|---|---|
| public V get(String s) Implements org. Doc from org. Get an exact match from a String key
| |
| get | back to summary |
|---|---|
| public V get(ByteBuffer b) Implements org. Doc from org. Get an exact match from a segment of a ByteBuffer as key
| |
| getBest | back to summary |
|---|---|
| public V getBest(String s) Implements org. Doc from org. Get the best match from key in a String, which may be a prefix match or an exact match.
| |
| getBest | back to summary |
|---|---|
| public V getBest(byte[] b, int offset, int len) 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.
| |
| isCaseInsensitive | back to summary |
|---|---|
| public boolean isCaseInsensitive() | |
| isCaseSensitive | back to summary |
|---|---|
| public boolean isCaseSensitive() | |
| put | back to summary |
|---|---|
| public boolean put(V v) Implements org. Doc from org. Put a value as both a key and a value.
| |
| putAll | back to summary |
|---|---|
| protected boolean putAll(Map<String, V> contents) | |
| remove | back to summary |
|---|---|
| public V remove(String s) Implements org. Doc from org. Remove an entry from the index.
| |
| requiredCapacity | back to summary |
|---|---|
| protected static int requiredCapacity(Set<String> keys, boolean caseSensitive) Calculate required Trie capacity in nodes of a tree decomposition of the keys. For example given the keys:
1 - 6
/
_ - 8
/
root - u - t - f - 1 - 6
\
8
The count also applies to ternary trees as follows:
root - u - t - f - _ ----- 1 - 6
\ \
1 - 6 8
\
8
In both cases above there are 10 character nodes plus the root node that can
hold a value for the empty string key, so the returned capacity is 11.
| |
| requiredCapacity | back to summary |
|---|---|
| private static int requiredCapacity(List<String> keys, int offset, int length, int index) Calculate required Trie capacity in nodes of a sub-tree decomposition of the keys. | |