fiftyone.mobile.detection.entities
Class Component

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

public class Component
extends BaseEntity
implements Comparable<Component>

Every device can be split into the major components of hardware, operating system and browser. These the properties and values associated with these components are represented via this class.


Field Summary
private  int componentId
          The unique Id of the component.
private  Profile defaultProfile
           
private  int defaultProfileOffset
           
private  String name
           
private  int nameOffset
           
private  Profile[] profiles
           
private  Property[] properties
           
 
Constructor Summary
Component(Dataset dataSet, int index, BinaryReader reader)
          Constructs a new instance of Component
 
Method Summary
 int compareTo(Component other)
          Compares this component to another using the numeric ComponentId field.
 int getComponentId()
           
 Profile getDefaultProfile()
          The default profile that should be returned for the component.
 String getName()
          The unique name of the component.
 Profile[] getProfiles()
          An array of the p
private  Profile[] GetProfiles()
          Returns an array of all the profiles that relate to this component.
 Property[] getProperties()
          Array of properties the component relates to.
private  Property[] GetProperties()
          Returns an array of the properties associated with the component.
 void init()
          Initialises the references to profiles.
 String toString()
           
 
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

componentId

private final int componentId
The unique Id of the component. Does not change between different data sets.


name

private String name

nameOffset

private final int nameOffset

properties

private Property[] properties

profiles

private Profile[] profiles

defaultProfile

private Profile defaultProfile

defaultProfileOffset

private final int defaultProfileOffset
Constructor Detail

Component

public Component(Dataset dataSet,
                 int index,
                 BinaryReader reader)
Constructs a new instance of Component

Parameters:
dataSet - The data set whose components list the component is contained within
index - Index of the component within the list
Method Detail

getName

public String getName()
               throws IOException
The unique name of the component.

Throws:
IOException

getProperties

public Property[] getProperties()
                         throws IOException
Array of properties the component relates to.

Throws:
IOException

getProfiles

public Profile[] getProfiles()
                      throws IOException
An array of the p

Throws:
IOException

getDefaultProfile

public Profile getDefaultProfile()
                          throws IOException
The default profile that should be returned for the component.

Throws:
IOException

init

public void init()
          throws IOException
Initialises the references to profiles.

Throws:
IOException

GetProperties

private Property[] GetProperties()
                          throws IOException
Returns an array of the properties associated with the component.

Returns:
Throws:
IOException

GetProfiles

private Profile[] GetProfiles()
                       throws IOException
Returns an array of all the profiles that relate to this component.

Returns:
Throws:
IOException

compareTo

public int compareTo(Component other)
Compares this component to another using the numeric ComponentId field.

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

getComponentId

public int getComponentId()

toString

public String toString()
Overrides:
toString in class Object