Package org.eclipse.jetty.util
Interface Trie<V>
-
- Type Parameters:
V- the Trie entry type
- All Known Implementing Classes:
AbstractTrie,ArrayTernaryTrie,ArrayTernaryTrie.Growing,ArrayTrie,TreeTrie
public interface Trie<V>A Trie String lookup data structure.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidclear()static <T> Trie<T>empty(boolean caseInsensitive)Vget(java.lang.String s)Get an exact match from a String keyVget(java.lang.String s, int offset, int len)Get an exact match from a String keyVget(java.nio.ByteBuffer b)Get an exact match from a segment of a ByteBuufer as keyVget(java.nio.ByteBuffer b, int offset, int len)Get an exact match from a segment of a ByteBuufer as keydefault VgetBest(byte[] b)VgetBest(byte[] b, int offset, int len)Get the best match from key in a byte array.VgetBest(java.lang.String s)Get the best match from key in a String.VgetBest(java.lang.String s, int offset, int len)Get the best match from key in a String.default VgetBest(java.nio.ByteBuffer b)VgetBest(java.nio.ByteBuffer b, int offset, int len)Get the best match from key in a byte buffer.booleanisCaseInsensitive()booleanisFull()java.util.Set<java.lang.String>keySet()booleanput(java.lang.String s, V v)Put an entry into the Triebooleanput(V v)Put a value as both a key and a value.Vremove(java.lang.String s)
-
-
-
Method Detail
-
put
boolean put(java.lang.String s, V v)Put an entry into the Trie- Parameters:
s- The key for the entryv- The value of the entry- Returns:
- True if the Trie had capacity to add the field.
-
put
boolean put(V v)
Put a value as both a key and a value.- Parameters:
v- The value and key- Returns:
- True if the Trie had capacity to add the field.
-
remove
V remove(java.lang.String s)
-
get
V get(java.lang.String s)
Get an exact match from a String key- Parameters:
s- The key- Returns:
- the value for the string key
-
get
V get(java.lang.String s, int offset, int len)
Get an exact match from a String key- Parameters:
s- The keyoffset- The offset within the string of the keylen- the length of the key- Returns:
- the value for the string / offset / length
-
get
V get(java.nio.ByteBuffer b)
Get an exact match from a segment of a ByteBuufer as key- Parameters:
b- The buffer- Returns:
- The value or null if not found
-
get
V get(java.nio.ByteBuffer b, int offset, int len)
Get 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
V getBest(java.lang.String s)
Get the best match from key in a String.- Parameters:
s- The string- Returns:
- The value or null if not found
-
getBest
V getBest(java.lang.String s, int offset, int len)
Get the best match from key in a String.- Parameters:
s- The stringoffset- The offset within the string of the keylen- the length of the key- Returns:
- The value or null if not found
-
getBest
V getBest(byte[] b, int offset, int len)
Get the best match from key in a byte array. The key is assumed to by ISO_8859_1 characters.- Parameters:
b- The bufferoffset- The offset within the array of the keylen- the length of the key- Returns:
- The value or null if not found
-
getBest
default V getBest(byte[] b)
-
getBest
V getBest(java.nio.ByteBuffer b, int offset, int len)
Get 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
-
getBest
default V getBest(java.nio.ByteBuffer b)
-
keySet
java.util.Set<java.lang.String> keySet()
-
isFull
boolean isFull()
-
isCaseInsensitive
boolean isCaseInsensitive()
-
clear
void clear()
-
empty
static <T> Trie<T> empty(boolean caseInsensitive)
-
-