public class Signature extends BaseEntity implements Comparable<Signature>
| Modifier and Type | Field and Description |
|---|---|
private int |
_length |
private String |
deviceId |
int[] |
nodeOffsets
List of the node indexes the signature relates to ordered by index of the
node.
|
private int[] |
profileOffsets |
private Profile[] |
profiles |
(package private) int |
rank |
private String |
stringValue |
private Value[] |
values |
| Constructor and Description |
|---|
Signature(Dataset dataSet,
int index,
BinaryReader reader)
Constructs a new instance of Signature
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(List<Node> nodes)
Compares this signature to a list of node offsets.
|
int |
compareTo(Signature other)
Compares this signature to another based on the node offsets.
|
String |
getDeviceId()
The unique Device Id for the signature.
|
int |
getLength()
The length in bytes of the signature.
|
Profile[] |
getProfiles()
List of the profiles the signature relates to.
|
private Profile[] |
getProfiles(int[] profileIndexes)
Returns an array of profiles associated with the signature.
|
SortedList<String,List<String>> |
getPropertyValuesAsStrings()
Gets a string list of the properties and names.
|
int |
getRank()
Gets the rank, where a lower number means the signature is more popular, of
the signature compared to other signatures.
|
private int |
getSignatureLength() |
private int |
getSignatureRank()
Gets the signature rank by iterating through the list of signature ranks.
|
Value[] |
getValues() |
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 String |
initGetDeviceId() |
private Value[] |
initGetValues()
Returns an array of values associated with the signature.
|
private int[] |
ReadOffsets(Dataset dataSet,
BinaryReader reader,
int length)
Uses the offsets list which must be locked to read in the arrays of nodes
or profiles that relate to the signature.
|
String |
toString()
String representation of the signature where irrelevant characters are
removed.
|
binarySearch, getDataSet, getIndex, readIntegerArraypublic final int[] nodeOffsets
private int[] profileOffsets
private Profile[] profiles
private String deviceId
private Value[] values
int rank
private int _length
private String stringValue
public Signature(Dataset dataSet, int index, BinaryReader reader)
dataSet - The data set the node is contained withinindex - The index in the data structure to the nodereader - Reader connected to the source data structure and
positioned to start readingpublic Profile[] getProfiles() throws IOException
IOExceptionpublic String getDeviceId() throws IOException
IOExceptionpublic Value[] getValues() throws IOException
IOExceptionpublic int getRank()
throws IOException
IOExceptionpublic int getLength()
throws IOException
IOExceptionprivate int getSignatureRank()
throws IOException
IOExceptionprivate int getSignatureLength()
throws IOException
IOExceptionprivate int[] ReadOffsets(Dataset dataSet, BinaryReader reader, int length)
dataSet - The data set the node is contained withinreader - Reader connected to the source data structure and
positioned to start readinglength - The number of offsets to read inpublic void init()
throws IOException
IOExceptionprivate String initGetDeviceId() throws IOException
IOExceptionpublic SortedList<String,List<String>> getPropertyValuesAsStrings() throws IOException
IOExceptionprivate Value[] initGetValues() throws IOException
IOExceptionprivate Profile[] getProfiles(int[] profileIndexes) throws IOException
profileIndexes - IOExceptionpublic int compareTo(List<Node> nodes)
nodeOffsets - The node indexes to be compared againstpublic int compareTo(Signature other)
compareTo in interface Comparable<Signature>other - The signature to be compared against