Package gov.nih.mipav.model.file
Class MetadataExtractor.ByteTrie<T>
java.lang.Object
gov.nih.mipav.model.file.MetadataExtractor.ByteTrie<T>
- Type Parameters:
T- the type of value to store for byte sequences
- Enclosing class:
MetadataExtractor
Stores values using a prefix tree (aka 'trie', i.e. reTRIEval data structure).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) classA node in the trie. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate final MetadataExtractor.ByteTrie<T>.ByteTrieNode<T> -
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.
-
Field Details
-
_root
-
_maxDepth
private int _maxDepth
-
-
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.
-