fiftyone.mobile.detection.entities
Class BaseEntity

java.lang.Object
  extended by fiftyone.mobile.detection.entities.BaseEntity
Direct Known Subclasses:
AsciiString, Component, Map, Node, NodeIndex, NodeNumericIndex, Profile, ProfileOffset, Property, RankedSignatureIndex, Signature, Value

public class BaseEntity
extends Object

Common properties and methods for all data types contained in the data set.


Field Summary
private  Dataset dataSet
          The data set the item relates to.
private  int offsetOrIndex
          The unique index of the item in the collection of items, or the unique offset to the item in the source data structure.
 
Constructor Summary
BaseEntity(Dataset dataSet, int offsetOrIndex)
          Constructs the base item for the data set and index provided.
 
Method Summary
protected  int binarySearch(BaseEntity[] list, int indexOrOffset)
          Uses a divide and conquer method to search the ordered list of indexes.
protected  Dataset getDataSet()
           
 int getIndex()
           
(package private) static int[] readIntegerArray(BinaryReader reader, int count)
          Reads an integer array where the first integer is the number of following integers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dataSet

private final Dataset dataSet
The data set the item relates to.


offsetOrIndex

private final int offsetOrIndex
The unique index of the item in the collection of items, or the unique offset to the item in the source data structure.

Constructor Detail

BaseEntity

BaseEntity(Dataset dataSet,
           int offsetOrIndex)
Constructs the base item for the data set and index provided.

Parameters:
dataSet - The data set the item is contained within
index - The index of the item within the dataset
Method Detail

binarySearch

protected int binarySearch(BaseEntity[] list,
                           int indexOrOffset)
Uses a divide and conquer method to search the ordered list of indexes.

Parameters:
list - List of entities to be searched
indexOrOffset - The index or offset to be sought
Returns:
The index of the entity in the list or twos complement of insert index

readIntegerArray

static int[] readIntegerArray(BinaryReader reader,
                              int count)
Reads an integer array where the first integer is the number of following integers.

Parameters:
reader - Reader set to the position at the start of the list
count - The number of integers to read to form the array
Returns:
An array of integers

getDataSet

protected Dataset getDataSet()

getIndex

public int getIndex()