V
- public class TreeTrie<V> extends AbstractTrie<V>
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 ArrayTrie 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.
Constructor and Description |
---|
TreeTrie() |
Modifier and Type | Method and Description |
---|---|
V |
get(ByteBuffer b,
int offset,
int len)
Get and exact match from a segment of a ByteBuufer as key
|
V |
get(String s,
int offset,
int len)
Get and exact match from a String key
|
V |
getBest(byte[] b,
int offset,
int len)
Get the best match from key in a byte array.
|
V |
getBest(ByteBuffer b,
int offset,
int len)
Get the best match from key in a byte buffer.
|
V |
getBest(String s,
int offset,
int len)
Get the best match from key in a String.
|
boolean |
isFull() |
Set<String> |
keySet() |
boolean |
put(String s,
V v)
Put and entry into the Trie
|
String |
toString() |
get, get, getBest, isCaseInsensitive, put, remove
public boolean put(String s, V v)
Trie
s
- The key for the entryv
- The value of the entrypublic V get(String s, int offset, int len)
Trie
s
- The keyoffset
- The offset within the string of the keylen
- the length of the keypublic V get(ByteBuffer b, int offset, int len)
Trie
b
- The bufferoffset
- The offset within the buffer of the keylen
- the length of the keypublic V getBest(byte[] b, int offset, int len)
Trie
public V getBest(String s, int offset, int len)
Trie
s
- The stringoffset
- The offset within the string of the keylen
- the length of the keypublic V getBest(ByteBuffer b, int offset, int len)
Trie
b
- The bufferoffset
- The offset within the buffer of the keylen
- the length of the keypublic boolean isFull()
Copyright © 1995-2015 Webtide. All Rights Reserved.