V - the entry typeTrie<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 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.
| Constructor | Description |
|---|---|
TreeTrie() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
clear() |
|
V |
get(java.lang.String s,
int offset,
int len) |
Get an exact match from a String key
|
V |
get(java.nio.ByteBuffer b,
int offset,
int len) |
Get an exact match from a segment of a ByteBuufer as key
|
V |
getBest(byte[] b,
int offset,
int len) |
Get the best match from key in a byte array.
|
V |
getBest(java.lang.String s,
int offset,
int len) |
Get the best match from key in a String.
|
V |
getBest(java.nio.ByteBuffer b,
int offset,
int len) |
Get the best match from key in a byte buffer.
|
boolean |
isFull() |
|
java.util.Set<java.lang.String> |
keySet() |
|
boolean |
put(java.lang.String s,
V v) |
Put an entry into the Trie
|
java.lang.String |
toString() |
get, get, getBest, isCaseInsensitive, put, removepublic void clear()
public boolean put(java.lang.String s,
V v)
Tries - The key for the entryv - The value of the entrypublic V get(java.lang.String s, int offset, int len)
Tries - The keyoffset - The offset within the string of the keylen - the length of the keypublic V get(java.nio.ByteBuffer b, int offset, int len)
Trieb - The bufferoffset - The offset within the buffer of the keylen - the length of the keypublic V getBest(byte[] b, int offset, int len)
Triepublic V getBest(java.lang.String s, int offset, int len)
Tries - The stringoffset - The offset within the string of the keylen - the length of the keypublic V getBest(java.nio.ByteBuffer b, int offset, int len)
Trieb - The bufferoffset - The offset within the buffer of the keylen - the length of the keypublic java.lang.String toString()
toString in class java.lang.Objectpublic java.util.Set<java.lang.String> keySet()
public boolean isFull()
Copyright © 1995–2017 Webtide. All rights reserved.