public class Dataset extends Object implements Disposable
The Memory.Reader and Stream.Reader factories should be used to create detector data sets. They can not be constructed directly from external code.
All information about the detector data set is exposed in this class including meta data and data used for device detection in the form of lists.
Detector data sets created using the
For more information see http://51degrees.mobi/Support/Documentation/Java
| Modifier and Type | Field and Description |
|---|---|
int |
age
Age of the data in months when exported.
|
private Component |
browsers |
ReadonlyList<Component> |
components |
protected String |
copyright |
protected int |
copyrightOffset |
private Component |
crawlers |
int |
csvBufferLength
The number of bytes to allocate to a buffer returning CSV format data for
a match.
|
int |
deviceCombinations
The number of unique device combinations available in the data set.
|
private boolean |
disposed |
protected String |
format |
protected int |
formatOffset |
Guid |
guid |
private Component |
hardware |
byte |
highestCharacter
The highest character the character trees can contain.
|
int |
jsonBufferLength
The number of bytes to allocate to a buffer returning JSON format data
for a match.
|
byte |
lowestCharacter
The lowest character the character trees can contain.
|
ReadonlyList<Map> |
maps |
int |
maxSignatures
The maximum number of signatures that can be checked.
|
int |
maxSignaturesClosest
The maximum number of signatures that could possibly be returned during a
closest match.
|
short |
maxUserAgentLength
The maximum length of a user agent string.
|
short |
maxValues
The maximum number of values that can be returned by a profile and a
property supporting a list of values.
|
int |
minUserAgentCount
The minimum number of times a user agent should have been seen before it
was included in the dataset.
|
private short |
minUserAgentLength
The minimum length of a user agent string.
|
private String |
name |
protected int |
nameOffset |
Date |
nextUpdate
The date the data set is next expected to be updated by 51Degrees.
|
ReadonlyList<Node> |
nodes
List of nodes the data set contains.
|
ReadonlyList<ProfileOffset> |
profileOffsets
List of profile offsets the data set contains.
|
ReadonlyList<Profile> |
profiles
A list of all the possible profiles the data set contains.
|
ReadonlyList<Property> |
properties |
Date |
published
The date the data set was published.
|
ReadonlyList<RankedSignatureIndex> |
rankedSignatureIndexes
A list of signature indexes ordered in ascending order of rank.
|
ReadonlyList<Node> |
rootNodes
Nodes for each of the possible character positions in the user agent.
|
private int |
signatureNodesCount |
private int |
signatureProfilesCount |
ReadonlyList<Signature> |
signatures
A list of all the signatures the data set contains.
|
private Component |
software |
ReadonlyList<AsciiString> |
strings
A list of ASCII byte arrays for strings used by the dataset.
|
ReadonlyList<Value> |
values |
Version |
version
The version of the data set.
|
int |
xmlBufferLength
The number of bytes to allocate to a buffer returning XML format data for
a match.
|
| Constructor and Description |
|---|
Dataset(BinaryReader reader)
Constructs a new data set ready to have lists of data assigned to it.
|
| Modifier and Type | Method and Description |
|---|---|
void |
dispose() |
Profile |
findProfile(int profileId)
Searches the list of profile Ids and returns the profile if the profile
id is valid.
|
Property |
get(String propertyName) |
Component |
getBrowsers()
The browser component.
|
Component |
getComponent(String componentName)
Returns the Component associated with the name provided.
|
ReadonlyList<Component> |
getComponents()
A list of all the components the data set contains.
|
String |
getCopyright()
The copyright notice associated with the data set.
|
Component |
getCrawlers()
The crawler component.
|
boolean |
getDisposed()
Indicates if the data set has been disposed.
|
String |
getFormat()
The name of the property map used to create the dataset.
|
Component |
getHardware()
The hardware component.
|
ReadonlyList<Map> |
getMaps()
A list of all property maps the data set contains.
|
short |
getMinUserAgentLength() |
String |
getName()
The common name of the data set.
|
ReadonlyList<Node> |
getNodes()
List of nodes the data set contains.
|
int |
getNodesCount() |
double |
getPercentageNodeCacheMisses()
The percentage of requests for nodes which were not already contained in
the cache.
|
double |
getPercentageProfilesCacheMisses()
The percentage of requests for profiles which were not already contained
in the cache.
|
double |
getPercentageSignatureCacheMisses()
The percentage of requests for signatures which were not already
contained in the cache.
|
double |
getPercentageStringsCacheMisses()
The percentage of requests for strings which were not already contained
in the cache.
|
double |
getPercentageValuesCacheMisses()
The percentage of requests for values which were not already contained in
the cache.
|
ReadonlyList<Profile> |
getProfiles()
A list of all the possible profiles the data set contains.
|
int |
getProfilesCount() |
ReadonlyList<Property> |
getProperties()
A list of all properties the data set contains.
|
ReadonlyList<Signature> |
getSignatures()
List of signatures the data set contains.
|
Component |
getSoftware()
The software component.
|
ReadonlyList<Value> |
getValues()
A list of all property values the data set contains.
|
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 static Date |
readDate(BinaryReader reader)
Reads a date in year, month and day order from the reader.
|
private boolean disposed
public final Date published
public final Date nextUpdate
public final int minUserAgentCount
public final Version version
public final short maxUserAgentLength
private final short minUserAgentLength
public final byte lowestCharacter
public final byte highestCharacter
public final int deviceCombinations
public final int maxSignatures
public final short maxValues
public final int csvBufferLength
public final int jsonBufferLength
public final int xmlBufferLength
public final int maxSignaturesClosest
public final Guid guid
public final int age
private Component hardware
private Component software
private Component browsers
private Component crawlers
protected String copyright
protected final int copyrightOffset
protected final int nameOffset
private String name
protected final int formatOffset
protected String format
public ReadonlyList<Component> components
public ReadonlyList<Map> maps
public ReadonlyList<Property> properties
public ReadonlyList<Value> values
public ReadonlyList<Signature> signatures
public ReadonlyList<RankedSignatureIndex> rankedSignatureIndexes
public ReadonlyList<Profile> profiles
public ReadonlyList<Node> nodes
public ReadonlyList<Node> rootNodes
public ReadonlyList<ProfileOffset> profileOffsets
public ReadonlyList<AsciiString> strings
private int signatureProfilesCount
private int signatureNodesCount
public Dataset(BinaryReader reader) throws IOException
reader - Reader connected to the source data structure and
positioned to start readingIOExceptionpublic double getPercentageSignatureCacheMisses()
A value is only returned when operating in Stream mode.
public double getPercentageNodeCacheMisses()
A value is only returned when operating in Stream mode.
public double getPercentageStringsCacheMisses()
A value is only returned when operating in Stream mode.
public double getPercentageProfilesCacheMisses()
A value is only returned when operating in Stream mode.
public double getPercentageValuesCacheMisses()
A value is only returned when operating in Stream mode.
public boolean getDisposed()
public Component getHardware() throws IOException
IOExceptionpublic Component getSoftware() throws IOException
IOExceptionpublic Component getBrowsers() throws IOException
IOExceptionpublic Component getCrawlers() throws IOException
IOExceptionpublic String getCopyright() throws IOException
IOExceptionpublic String getName() throws IOException
IOExceptionpublic String getFormat() throws IOException
IOExceptionpublic ReadonlyList<Component> getComponents()
public ReadonlyList<Map> getMaps()
public ReadonlyList<Property> getProperties()
public ReadonlyList<Value> getValues()
public ReadonlyList<Signature> getSignatures()
private static Date readDate(BinaryReader reader)
reader - Reader positioned at the start of the datepublic ReadonlyList<Node> getNodes()
public ReadonlyList<Profile> getProfiles()
public short getMinUserAgentLength()
public void init()
throws IOException
IOExceptionpublic Component getComponent(String componentName) throws IOException
componentName - IOExceptionpublic Property get(String propertyName) throws IOException
IOExceptionpublic int getProfilesCount()
public int getNodesCount()
public Profile findProfile(int profileId) throws IOException
profileId - Id of the profile to be foundIOExceptionpublic void dispose()
dispose in interface Disposable