protected static class StringDecoderCache.TrieCache extends Object
The trie is designed to be used in a RCU fashion where the trie is
constructed as a series of addEntry(byte[], String)
calls and
once the trie is fully populated then is can be queried using
find(byte[], int, int)
.
Modifier and Type | Class and Description |
---|---|
protected static class |
StringDecoderCache.TrieCache.TrieNode
Node provides a single node in the trie.
|
Constructor and Description |
---|
StringDecoderCache.TrieCache()
Creates a new TrieCache.
|
public StringDecoderCache.TrieCache()
public void addEntry(byte[] source, String value)
source
- The source of the bytes in the string.value
- The value to associate with the entry.public String find(byte[] source, int offset, int length)
source
- The source of the bytes in the string.offset
- The offset of the first byte to decode.length
- The length of the string to decode with a terminal zero
byte.Copyright © 2011–2014 Allanbank Consulting, Inc.. All rights reserved.