|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfiftyone.mobile.detection.entities.BaseEntity
fiftyone.mobile.detection.entities.NodeIndex
public class NodeIndex
A node index contains the characters and related child nodes of the current node should any of the characters match at the position.
| Field Summary | |
|---|---|
private byte[] |
characters
|
(package private) boolean |
isString
True if the value is an index to a sub string. |
private Node |
node
|
(package private) int |
relatedNodeOffset
The node index for the sequence of characters. |
private byte[] |
value
The value of the node index. |
| Constructor Summary | |
|---|---|
NodeIndex(Dataset dataSet,
int index,
boolean isString,
byte[] value,
int relatedNodeOffset)
Constructs a new instance of NodeIndex |
|
| Method Summary | |
|---|---|
(package private) int |
compareTo(byte[] other,
int startIndex)
Compares a byte array of characters at the position provided to the array of characters for this node. |
int |
compareTo(NodeIndex other)
Compares this node index to another. |
(package private) byte[] |
getCharacters()
Returns the characters related to this node index. |
private static byte[] |
getCharacters(Dataset dataSet,
boolean isString,
byte[] value)
Returns the characters the node index relates to. |
(package private) Node |
getNode()
The node this index relates to. |
(package private) void |
init()
Called after the entire data set has been loaded to ensure any further initialisation steps that require other items in the data set can be completed. |
private static byte[] |
nonZeros(byte[] value)
Returns the non zero values in the array. |
String |
toString()
Converts the node index into a string. |
| Methods inherited from class fiftyone.mobile.detection.entities.BaseEntity |
|---|
binarySearch, getDataSet, getIndex, readIntegerArray |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
final int relatedNodeOffset
final boolean isString
private final byte[] value
private byte[] characters
private Node node
| Constructor Detail |
|---|
public NodeIndex(Dataset dataSet,
int index,
boolean isString,
byte[] value,
int relatedNodeOffset)
dataSet - The data set the node is contained withinindex - The index of this object in the NodeisString - True if the value is an integer offset to a string, or
false if the value is an array of characters to be used by the node.value - Array of bytes representing an integer offset to a string,
or the array of characters to be used by the node.relatedNodeOffset - The offset in the list of nodes to the node the
index relates to| Method Detail |
|---|
byte[] getCharacters()
throws IOException
IOException
Node getNode()
throws IOException
IOException
void init()
throws IOException
IOException
private static byte[] getCharacters(Dataset dataSet,
boolean isString,
byte[] value)
throws IOException
dataSet - isString - value -
IOExceptionprivate static byte[] nonZeros(byte[] value)
value - An array of values.
int compareTo(byte[] other,
int startIndex)
throws IOException
other - Array of characters to comparestartIndex - The index in the other array to the required characters
IOExceptionpublic int compareTo(NodeIndex other)
compareTo in interface Comparable<NodeIndex>other - The node index to compare
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||