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
public class MetadataExtractor.ByteTrie<T> extends java.lang.ObjectStores values using a prefix tree (aka 'trie', i.e. reTRIEval data structure).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classMetadataExtractor.ByteTrie.ByteTrieNode<T>A node in the trie.
-
Field Summary
Fields Modifier and Type Field Description private int_maxDepthprivate MetadataExtractor.ByteTrie.ByteTrieNode<T>_root
-
Constructor Summary
Constructors Constructor Description ByteTrie()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPath(T value, byte[]... parts)Store the given value at the specified path.Tfind(byte[] bytes)Return the most specific value stored for this byte sequence.Tfind(byte[] bytes, int offset, int count)Return the most specific value stored for this byte sequence.intgetMaxDepth()Gets the maximum depth stored in this trie.voidsetDefaultValue(T defaultValue)Sets the default value to use infind(byte[])when no path matches.
-
-
-
Field Detail
-
_root
private final MetadataExtractor.ByteTrie.ByteTrieNode<T> _root
-
_maxDepth
private int _maxDepth
-
-
Method Detail
-
find
public T find(byte[] bytes)
Return the most specific value stored for this byte sequence. If not found, returnsnullor a default values as specified by callingsetDefaultValue(T).
-
find
public T find(byte[] bytes, int offset, int count)
Return the most specific value stored for this byte sequence. If not found, returnsnullor a default values as specified by callingsetDefaultValue(T).
-
addPath
public void addPath(T value, byte[]... parts)
Store the given value at the specified path.
-
setDefaultValue
public void setDefaultValue(T defaultValue)
Sets the default value to use infind(byte[])when no path matches.
-
getMaxDepth
public int getMaxDepth()
Gets the maximum depth stored in this trie.
-
-