public abstract class Component extends BaseEntity implements Comparable<Component>
Components are always held in memory as there is only a small number of them.
Full list of components in the data set can be retrieved like:
dataSet.getComponents();. Data set also provides a way to retrieve a
specific component:
dataSet.getHardware();
dataSet.getSoftware();
dataSet.getBrowsers();
dataSet.getCrawlers();
Component can be used to retrieve profiles and
properties.
Objects of this class should not be created directly as they are part of the
internal logic. Use the relevant Dataset method to access these
objects.
For more information see: 51Degrees pattern data model.
dataSet, index| Constructor and Description |
|---|
Component(Dataset dataSet,
int index,
BinaryReader reader)
Constructs a new instance of Component
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Component other)
Compares this component to another using the numeric ComponentId field.
|
boolean |
equals(Component other)
Compares this instance to another using the component Id.
|
int |
getComponentId()
The unique Id of the component.
|
Profile |
getDefaultProfile()
The default profile that should be returned for the component.
|
abstract String[] |
getHttpheaders()
List of HTTP headers that should be checked in order to perform a
detection where more headers than User-Agent are available.
|
String |
getName()
The unique name of the component as a string.
|
Profile[] |
getProfiles()
An array of profiles associated with the component.
|
Property[] |
getProperties()
Array of properties the component relates to.
|
void |
init()
Initialises the references to profiles.
|
String |
toString()
Returns the components name.
|
compareTo, compareTo, getDataSet, getIndex, getIsNumeric, getNumber, readIntegerArray, readIntegerListpublic Component(Dataset dataSet, int index, BinaryReader reader)
dataSet - The data set whose components list the component is
contained within.index - Index of the component within the list.reader - the BinaryReader object to be used.public int compareTo(Component other)
compareTo in interface Comparable<Component>other - The component to be compared against.public Profile getDefaultProfile() throws IOException
IOException - If there was a problem accessing data file.public Profile[] getProfiles() throws IOException
profiles.IOException - if there was a problem accessing data file.public Property[] getProperties() throws IOException
properties the component relates to.IOException - if there was a problem accessing data file.public void init()
throws IOException
IOException - if there was a problem accessing data file.public String getName() throws IOException
IOException - if there was a problem accessing data file.public int getComponentId()
Profile IDs.public String toString()
public abstract String[] getHttpheaders() throws IOException
IOException - if there was a problem accessing data file.public boolean equals(Component other)
other - The component to be compared against.componentId of this component is equal to the
ComponentId of the other component.Copyright © 2017 51Degrees. All rights reserved.