public class DataPoint
extends java.lang.Object
These data points includes other features such as timestamp, description, quality and location, that can be optionally configured.
Data points can be sent to Device Cloud using the following methods from Cloud Connector object:
DataStream,
BinaryDataPoint| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DESCRIPTION_UNUSED
Constant defining the description is not used.
|
static Location |
LOCATION_UNUSED
Constant defining the location is not used.
|
static java.lang.Integer |
QUALITY_UNUSED
Constant defining the quality is not used.
|
static int |
TYPE_BINARY
Constant defining the binary data point type.
|
static int |
TYPE_DOUBLE
Constant defining the double data point type.
|
static int |
TYPE_FLOAT
Constant defining the float data point type.
|
static int |
TYPE_INTEGER
Constant defining the integer data point type.
|
static int |
TYPE_LONG
Constant defining the long data point type.
|
static int |
TYPE_STRING
Constant defining the string data point type.
|
static java.lang.String |
USE_DEFAULT_TIMEOUT
Constant indicating the defined default timeout should be used.
|
| Constructor and Description |
|---|
DataPoint(byte[] data,
DataStream stream)
Class constructor.
|
DataPoint(byte[] data,
DataStream stream,
java.lang.String description,
java.lang.String timestamp,
java.lang.Integer quality,
Location location)
Class constructor.
|
DataPoint(double data,
DataStream stream)
Class constructor.
|
DataPoint(double data,
DataStream stream,
java.lang.String description,
java.lang.String timestamp,
java.lang.Integer quality,
Location location)
Class constructor.
|
DataPoint(float data,
DataStream stream)
Class constructor.
|
DataPoint(float data,
DataStream stream,
java.lang.String description,
java.lang.String timestamp,
java.lang.Integer quality,
Location location)
Class constructor.
|
DataPoint(int data,
DataStream stream)
Class constructor.
|
DataPoint(int data,
DataStream stream,
java.lang.String description,
java.lang.String timestamp,
java.lang.Integer quality,
Location location)
Class constructor.
|
DataPoint(long data,
DataStream stream)
Class constructor.
|
DataPoint(long data,
DataStream stream,
java.lang.String description,
java.lang.String timestamp,
java.lang.Integer quality,
Location location)
Class constructor.
|
DataPoint(java.lang.String data,
DataStream stream)
Class constructor.
|
DataPoint(java.lang.String data,
DataStream stream,
java.lang.String description,
java.lang.String timestamp,
java.lang.Integer quality,
Location location)
Class constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getData()
Retrieves the data point data.
|
DataStream |
getDataStream()
Retrieves the data stream destination of the data point.
|
java.lang.String |
getDescription()
Retrieves the data point description.
|
Location |
getLocation()
Retrieves the data point location.
|
java.lang.Integer |
getQuality()
Retrieves the data point quality.
|
java.lang.String |
getTimestamp()
Retrieves the data point timestamp.
|
int |
getType()
Retrieves the data point type.
|
java.lang.String |
getTypeName()
Retrieves the data point type name.
|
void |
setDescription(java.lang.String description)
Sets the data point description.
|
void |
setLocation(Location location)
Sets the data point location.
|
void |
setQuality(java.lang.Integer quality)
Sets the data point quality.
|
void |
setTimestamp(java.lang.String timestamp)
Sets the data point timestamp.
|
java.lang.String |
toCSVFormat(boolean complete)
Retrieves the data point in CVS format.
|
static void |
useSystemTime(boolean useSystemTime)
Sets whether system time should be used or not when creating data points.
|
public static java.lang.String DESCRIPTION_UNUSED
public static Location LOCATION_UNUSED
public static java.lang.Integer QUALITY_UNUSED
public static final int TYPE_BINARY
public static final int TYPE_DOUBLE
public static final int TYPE_FLOAT
public static final int TYPE_INTEGER
public static final int TYPE_LONG
public static final int TYPE_STRING
public static java.lang.String USE_DEFAULT_TIMEOUT
useSystemTime(boolean)public DataPoint(byte[] data,
DataStream stream)
By default the system time will be used when creating a new data point,
use the static useSystemTime(boolean) method to use Device
Cloud time.
data - Data point value.stream - Data stream destination of this data point.java.lang.IllegalArgumentException - if data == null or
if stream == null.public DataPoint(byte[] data,
DataStream stream,
java.lang.String description,
java.lang.String timestamp,
java.lang.Integer quality,
Location location)
data - Data point value.stream - Data stream destination of this data point.description - Data point description or DESCRIPTION_UNUSED.timestamp - Data point timestamp or USE_DEFAULT_TIMEOUT to
use the system time (default) or Device Cloud time,
depending on the static call to
useSystemTime(boolean).quality - User-defined 32-bit integer value representing the quality
of the data in the data point or QUALITY_UNUSED.location - Data point location or LOCATION_UNUSED.java.lang.IllegalArgumentException - if data == null or
if stream == null.DESCRIPTION_UNUSED,
USE_DEFAULT_TIMEOUT,
QUALITY_UNUSED,
LOCATION_UNUSEDpublic DataPoint(double data,
DataStream stream)
By default the system time will be used when creating a new data point,
use the static useSystemTime(boolean) method to use Device
Cloud time.
data - Data point value.stream - Data stream destination of this data point.java.lang.IllegalArgumentException - if stream == null.public DataPoint(double data,
DataStream stream,
java.lang.String description,
java.lang.String timestamp,
java.lang.Integer quality,
Location location)
data - Data point value.stream - Data stream destination of this data point.description - Data point description or DESCRIPTION_UNUSED.timestamp - Data point timestamp or USE_DEFAULT_TIMEOUT to
use the system time (default) or Device Cloud time,
depending on the static call to
useSystemTime(boolean).quality - User-defined 32-bit integer value representing the quality
of the data in the data point or QUALITY_UNUSED.location - Data point location or LOCATION_UNUSED.java.lang.IllegalArgumentException - if stream == null.DESCRIPTION_UNUSED,
USE_DEFAULT_TIMEOUT,
QUALITY_UNUSED,
LOCATION_UNUSEDpublic DataPoint(float data,
DataStream stream)
By default the system time will be used when creating a new data point,
use the static useSystemTime(boolean) method to use Device
Cloud time.
data - Data point value.stream - Data stream destination of this data point.java.lang.IllegalArgumentException - if stream == null.public DataPoint(float data,
DataStream stream,
java.lang.String description,
java.lang.String timestamp,
java.lang.Integer quality,
Location location)
data - Data point value.stream - Data stream destination of this data point.description - Data point description or DESCRIPTION_UNUSED.timestamp - Data point timestamp or USE_DEFAULT_TIMEOUT to
use the system time (default) or Device Cloud time,
depending on the static call to
useSystemTime(boolean).quality - User-defined 32-bit integer value representing the quality
of the data in the data point or QUALITY_UNUSED.location - Data point location or LOCATION_UNUSED.java.lang.IllegalArgumentException - if stream == null.DESCRIPTION_UNUSED,
USE_DEFAULT_TIMEOUT,
QUALITY_UNUSED,
LOCATION_UNUSEDpublic DataPoint(int data,
DataStream stream)
By default the system time will be used when creating a new data point,
use the static useSystemTime(boolean) method to use Device
Cloud time.
data - Data point value.stream - Data stream destination of this data point.java.lang.IllegalArgumentException - if stream == null.public DataPoint(int data,
DataStream stream,
java.lang.String description,
java.lang.String timestamp,
java.lang.Integer quality,
Location location)
data - Data point value.stream - Data stream destination of this data point.description - Data point description or DESCRIPTION_UNUSED.timestamp - Data point timestamp or USE_DEFAULT_TIMEOUT to
use the system time (default) or Device Cloud time,
depending on the static call to
useSystemTime(boolean).quality - User-defined 32-bit integer value representing the quality
of the data in the data point or QUALITY_UNUSED.location - Data point location or LOCATION_UNUSED.java.lang.IllegalArgumentException - if stream == null.DESCRIPTION_UNUSED,
USE_DEFAULT_TIMEOUT,
QUALITY_UNUSED,
LOCATION_UNUSEDpublic DataPoint(long data,
DataStream stream)
By default the system time will be used when creating a new data point,
use the static useSystemTime(boolean) method to use Device
Cloud time.
data - Data point value.stream - Data stream destination of this data point.java.lang.IllegalArgumentException - if stream == null.public DataPoint(long data,
DataStream stream,
java.lang.String description,
java.lang.String timestamp,
java.lang.Integer quality,
Location location)
data - Data point value.stream - Data stream destination of this data point.description - Data point description or DESCRIPTION_UNUSED.timestamp - Data point timestamp or USE_DEFAULT_TIMEOUT to
use the system time (default) or Device Cloud time,
depending on the static call to
useSystemTime(boolean).quality - User-defined 32-bit integer value representing the quality
of the data in the data point or QUALITY_UNUSED.location - Data point location or LOCATION_UNUSED.java.lang.IllegalArgumentException - if stream == null.DESCRIPTION_UNUSED,
USE_DEFAULT_TIMEOUT,
QUALITY_UNUSED,
LOCATION_UNUSEDpublic DataPoint(java.lang.String data,
DataStream stream)
By default the system time will be used when creating a new data point,
use the static useSystemTime(boolean) method to use Device
Cloud time.
data - Data point value.stream - Data stream destination of this data point.java.lang.IllegalArgumentException - if data == null or
if stream == null.public DataPoint(java.lang.String data,
DataStream stream,
java.lang.String description,
java.lang.String timestamp,
java.lang.Integer quality,
Location location)
data - Data point value.stream - Data stream destination of this data point.description - Data point description or DESCRIPTION_UNUSED.timestamp - Data point timestamp or USE_DEFAULT_TIMEOUT to
use the system time (default) or Device Cloud time,
depending on the static call to
useSystemTime(boolean).quality - User-defined 32-bit integer value representing the quality
of the data in the data point or QUALITY_UNUSED.location - Data point location or LOCATION_UNUSED.java.lang.IllegalArgumentException - if data == null or
if stream == null.DESCRIPTION_UNUSED,
USE_DEFAULT_TIMEOUT,
QUALITY_UNUSED,
LOCATION_UNUSEDpublic java.lang.String getData()
public DataStream getDataStream()
public java.lang.String getDescription()
DESCRIPTION_UNUSED if the
description was not provided.DESCRIPTION_UNUSED,
setDescription(String)public Location getLocation()
LOCATION_UNUSED if the
location was not provided.LOCATION_UNUSED,
setLocation(Location)public java.lang.Integer getQuality()
QUALITY_UNUSED if the quality
was not provided.QUALITY_UNUSED,
setQuality(Integer)public java.lang.String getTimestamp()
USE_DEFAULT_TIMEOUT if the
Device Cloud time will be used.USE_DEFAULT_TIMEOUT,
useSystemTime(boolean),
setTimestamp(String)public int getType()
TYPE_BINARY,
TYPE_DOUBLE,
TYPE_FLOAT,
TYPE_INTEGER,
TYPE_LONG,
TYPE_STRING,
getTypeName()public java.lang.String getTypeName()
TYPE_BINARY,
TYPE_DOUBLE,
TYPE_FLOAT,
TYPE_INTEGER,
TYPE_LONG,
TYPE_STRING,
getType()public void setDescription(java.lang.String description)
description - The data point description.DESCRIPTION_UNUSED,
getDescription()public void setLocation(Location location)
location - The data point location.LOCATION_UNUSED,
getLocation()public void setQuality(java.lang.Integer quality)
quality - User-defined 32-bit integer value representing the quality
of the data in the data point.QUALITY_UNUSED,
getQuality()public void setTimestamp(java.lang.String timestamp)
USE_DEFAULT_TIMEOUT,
the defined default timestamp will be used.timestamp - Data point timestamp or USE_DEFAULT_TIMEOUT to use the
system time (default) or Device Cloud time, depending
on the static call to useSystemTime(boolean).USE_DEFAULT_TIMEOUT,
useSystemTime(boolean),
getTimestamp()public java.lang.String toCSVFormat(boolean complete)
complete - if true the stream data (datatype, units,
forwardTo) is also added to the CSV string, false
otherwise.public static void useSystemTime(boolean useSystemTime)
useSystemTime - true to use system time, false to
use Device Cloud time.© Copyright 2014 Etherios, Inc. All rights reserved. Etherios, Inc. is a Division of Digi International Inc.