Package com.drew.lang
Class ByteTrie<T>
java.lang.Object
com.drew.lang.ByteTrie<T>
- Type Parameters:
T- the type of value to store for byte sequences
Stores values using a prefix tree (aka 'trie', i.e. reTRIEval data structure).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidStore the given value at the specified path.find(byte[] bytes) Return the most specific value stored for this byte sequence.find(byte[] bytes, int offset, int count) Return the most specific value stored for this byte sequence.intGets the maximum depth stored in this trie.voidsetDefaultValue(T defaultValue) Sets the default value to use infind(byte[])when no path matches.
-
Constructor Details
-
ByteTrie
public ByteTrie()
-
-
Method Details
-
find
Return the most specific value stored for this byte sequence. If not found, returnsnullor a default values as specified by callingsetDefaultValue(T). -
find
Return the most specific value stored for this byte sequence. If not found, returnsnullor a default values as specified by callingsetDefaultValue(T). -
addPath
Store the given value at the specified path. -
setDefaultValue
Sets the default value to use infind(byte[])when no path matches. -
getMaxDepth
public int getMaxDepth()Gets the maximum depth stored in this trie.
-