Class TreeTrie<V>
java.lang.Object
org.eclipse.jetty.util.AbstractTrie<V>
org.eclipse.jetty.util.TreeTrie<V>
- Type Parameters:
V- the entry type
- All Implemented Interfaces:
Trie<V>
A Trie String lookup data structure using a tree
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final charprivate Stringprivate Vprivate static final intprivate static final int[]Fields inherited from class AbstractTrie
_caseInsensitive -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Get an exact match from a String keyget(ByteBuffer b, int offset, int len) Get an exact match from a segment of a ByteBuufer as keygetBest(byte[] b, int offset, int len) Get the best match from key in a byte array.Get the best match from key in a String.getBest(ByteBuffer b, int offset, int len) Get the best match from key in a byte buffer.private VgetBestByteBuffer(ByteBuffer b, int offset, int len) booleanisFull()keySet()private static <V> voidbooleanPut an entry into the TrietoString()private static <V> voidtoString(Appendable out, TreeTrie<V> t) Methods inherited from class AbstractTrie
get, get, getBest, isCaseInsensitive, put, remove
-
Field Details
-
LOOKUP
private static final int[] LOOKUP -
INDEX
private static final int INDEX- See Also:
-
_nextIndex
-
_nextOther
-
_c
private final char _c -
_key
-
_value
-
-
Constructor Details
-
TreeTrie
public TreeTrie() -
TreeTrie
private TreeTrie(char c)
-
-
Method Details
-
clear
public void clear() -
put
-
get
-
get
Description copied from interface:TrieGet an exact match from a segment of a ByteBuufer as key- Parameters:
b- The bufferoffset- The offset within the buffer of the keylen- the length of the key- Returns:
- The value or null if not found
-
getBest
Description copied from interface:TrieGet the best match from key in a byte array. The key is assumed to by ISO_8859_1 characters. -
getBest
-
getBest
Description copied from interface:TrieGet the best match from key in a byte buffer. The key is assumed to by ISO_8859_1 characters.- Parameters:
b- The bufferoffset- The offset within the buffer of the keylen- the length of the key- Returns:
- The value or null if not found
-
getBestByteBuffer
-
toString
-
toString
-
keySet
-
keySet
-
isFull
public boolean isFull()
-