fiftyone.mobile.detection.entities
Class Profile

java.lang.Object
  extended by fiftyone.mobile.detection.entities.BaseEntity
      extended by fiftyone.mobile.detection.entities.Profile
All Implemented Interfaces:
Comparable<Profile>

public class Profile
extends BaseEntity
implements Comparable<Profile>

Represents a collection of properties and values relating to a profile which in turn relates to a component.

Each Signature relates to one profile for each component.


Field Summary
private  Component component
           
private  int componentIndex
           
private static int MIN_LENGTH
           
private  SortedList<String,Values> nameToValues
           
 int profileId
          Unique Id of the profile.
private  Property[] properties
           
private static Comparator<Value> propertyComparator
          Comparator used to order the properties by descending display order.
private  int[] signatureIndexes
           
private  Signature[] signatures
           
private  String stringValue
           
private  int[] valueIndexes
          A list of the indexes of the values associated with the profile.
private  Value[] values
           
 
Constructor Summary
Profile(Dataset dataSet, int offset, BinaryReader reader)
          Constructs a new instance of the Profile
 
Method Summary
 int compareTo(Profile other)
          Compares this profile to another using the numeric ProfileId field.
 Component getComponent()
          The component the profile belongs to.
 int getLength()
           
 Property[] getProperties()
          An array of properties associated with the profile.
private  Property[] GetProperties()
          Returns an array of properties the profile relates to.
 int[] getSignatureIndexes()
           
private  Signature[] GetSignatures()
          Returns an array of signatures the profile relates to.
 int[] getValueIndexes()
           
 Value[] getValues()
          An array of values associated with the profile.
private  Value[] GetValues()
          Returns an array of values the profile relates to.
 Values getValues(Property property)
          Gets the values associated with the property.
 Values getValues(String propertyName)
          Gets the values associated with the property name.
 void init()
          If storage of object references is enabled initialises the arrays of related properties and values.
 Signature[] Signatures()
          Array of signatures associated with the profile.
 String toString()
          A string representation of the profiles display values.
 
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

propertyComparator

private static final Comparator<Value> propertyComparator
Comparator used to order the properties by descending display order.


profileId

public final int profileId
Unique Id of the profile. Does not change between different data sets.


valueIndexes

private final int[] valueIndexes
A list of the indexes of the values associated with the profile.


nameToValues

private SortedList<String,Values> nameToValues

signatures

private Signature[] signatures

signatureIndexes

private final int[] signatureIndexes

component

private Component component

componentIndex

private final int componentIndex

values

private Value[] values

properties

private Property[] properties

stringValue

private String stringValue

MIN_LENGTH

private static final int MIN_LENGTH
See Also:
Constant Field Values
Constructor Detail

Profile

public Profile(Dataset dataSet,
               int offset,
               BinaryReader reader)
Constructs a new instance of the Profile

Parameters:
dataSet - The data set the profile will be contained with in
offset - The offset of the profile in the source data structure
Method Detail

getValues

public Values getValues(String propertyName)
                 throws IOException
Gets the values associated with the property name.

Parameters:
propertyName - Name of the property whose values are required
Returns:
Array of the values associated with the property, or null if the property does not exist
Throws:
IOException

getValues

public Values getValues(Property property)
                 throws IOException
Gets the values associated with the property.

Parameters:
property - The property whose values are required
Returns:
Array of the values associated with the property, or null if the property does not exist
Throws:
IOException

Signatures

public Signature[] Signatures()
                       throws IOException
Array of signatures associated with the profile.

Throws:
IOException

getComponent

public Component getComponent()
                       throws IOException
The component the profile belongs to.

Throws:
IOException

getValues

public Value[] getValues()
                  throws IOException
An array of values associated with the profile.

Throws:
IOException

getProperties

public Property[] getProperties()
                         throws IOException
An array of properties associated with the profile.

Throws:
IOException

init

public void init()
          throws IOException
If storage of object references is enabled initialises the arrays of related properties and values.

Throws:
IOException

GetSignatures

private Signature[] GetSignatures()
                           throws IOException
Returns an array of signatures the profile relates to.

Returns:
Throws:
IOException

GetProperties

private Property[] GetProperties()
                          throws IOException
Returns an array of properties the profile relates to.

Returns:
Throws:
IOException

GetValues

private Value[] GetValues()
                   throws IOException
Returns an array of values the profile relates to.

Returns:
Throws:
IOException

compareTo

public int compareTo(Profile other)
Compares this profile to another using the numeric ProfileId field.

Specified by:
compareTo in interface Comparable<Profile>
Parameters:
other - The component to be compared against
Returns:
Indication of relative value based on ProfileId field

toString

public String toString()
A string representation of the profiles display values.

Overrides:
toString in class Object
Returns:
the profile as a string

getValueIndexes

public int[] getValueIndexes()

getSignatureIndexes

public int[] getSignatureIndexes()

getLength

public int getLength()