public class SensorData
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private long |
creationTime
The time when this data was created.
|
private ReasonerDimension |
dimension
The
ReasonerDimension for which this data object was measured. |
private java.lang.String |
name
The name of the sensor, which provides this data object.
|
private java.util.Map<java.lang.Integer,java.lang.Double> |
values
The list of values measured by the sensor.
|
Constructor and Description |
---|
SensorData(java.lang.String sensorName,
ReasonerDimension dataDimension,
double sensorValue)
Creates a new sensor data object.
|
SensorData(java.lang.String sensorName,
ReasonerDimension dataDimension,
double[] sensorValues)
Creates a new sensor data object.
|
SensorData(java.lang.String sensorName,
ReasonerDimension dataDimension,
java.util.Map<java.lang.Integer,java.lang.Double> sensorValues)
Creates a new sensor data object.
|
Modifier and Type | Method and Description |
---|---|
protected long |
getCreationTime()
Returns the creation time of this data as UNIX timestamp.
|
ReasonerDimension |
getDimension()
Returns the data dimension as
ReasonerDimension . |
java.lang.String |
getName()
Returns the name of the sensor, which measured this value.
|
double |
getValue()
Returns the first value of the value scalar for downwards compatibility.
|
double |
getValue(int index)
Returns the n-th dimension of the value scalar measured by the sensor.
|
java.util.Map<java.lang.Integer,java.lang.Double> |
getValues()
Returns the value scalar as Map<Integer, Double>.
|
java.lang.String |
toString() |
private java.lang.String name
private ReasonerDimension dimension
ReasonerDimension
for which this data object was measured.private java.util.Map<java.lang.Integer,java.lang.Double> values
private final long creationTime
public SensorData(java.lang.String sensorName, ReasonerDimension dataDimension, double sensorValue)
sensorName
- The name of the sensor, which provides this data object.dataDimension
- The ReasonerDimension
for which this data object was measured.sensorValue
- The value measured by the sensor.public SensorData(java.lang.String sensorName, ReasonerDimension dataDimension, double[] sensorValues)
sensorName
- The name of the sensor, which provides this data object.dataDimension
- The ReasonerDimension
for which this data object was measured.sensorValues
- The value measured by the sensor.public SensorData(java.lang.String sensorName, ReasonerDimension dataDimension, java.util.Map<java.lang.Integer,java.lang.Double> sensorValues)
sensorName
- The name of the sensor, which provides this data object.dataDimension
- The ReasonerDimension
for which this data object was measured.sensorValues
- The value measured by the sensor.public final java.lang.String getName()
public final ReasonerDimension getDimension()
ReasonerDimension
.ReasonerDimension
of this data object.public final double getValue()
public final java.util.Map<java.lang.Integer,java.lang.Double> getValues()
public final double getValue(int index)
index
- The dimension as integer.protected final long getCreationTime()
public final java.lang.String toString()
toString
in class java.lang.Object
String
representation of this object.Object.toString()