de.Android_Seminar.backend.impl
Class SensorDataImpl
java.lang.Object
de.Android_Seminar.backend.impl.SensorDataImpl
- All Implemented Interfaces:
- SensorData
public class SensorDataImpl
- extends java.lang.Object
- implements SensorData
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SensorDataImpl
public SensorDataImpl(SensorType sensor,
int length)
- standard constructor
- Parameters:
sensor
- the sensor typelength
- the number of values saved in this data set- See Also:
SensorData.getLength()
,
SensorData.getSensorType()
getLength
public int getLength()
- Specified by:
getLength
in interface SensorData
- Returns:
- the number of values, a data set consists of.
e.g. a accelerometer data set consists of 3 values (x, y, z)
a temperature data set consists of only 1 value
getSensorType
public SensorType getSensorType()
- Specified by:
getSensorType
in interface SensorData
- Returns:
- the sensor type for which data can be saved in this data set
- See Also:
SensorType
getTimeStamp
public java.sql.Timestamp getTimeStamp()
- Specified by:
getTimeStamp
in interface SensorData
- Returns:
- the time stamp this a data set has been recorded
- See Also:
Timestamp
getValues
public double[] getValues()
- Specified by:
getValues
in interface SensorData
- Returns:
- all values for one data set
e.g. a accelerometer data set consists of 3 values (x, y, z)
a temperature data set consists of only 1 value
- See Also:
SensorData#setValues(float[])
setValues
public void setValues(double[] newValues,
long timestamp)
- Specified by:
setValues
in interface SensorData
- Parameters:
newValues
- sets the values for one data set
e.g. a accelerometer data set consists of 3 values (x, y, z)
a temperature data set consists of only 1 valuetimestamp
- the time when the data was changed
(time in milliseconds since January 1, 1970 00:00:00 UTC)- See Also:
SensorData.getValues()
getLocation
public Location getLocation()
- Specified by:
getLocation
in interface SensorData
- Returns:
- the location at which the data set has been recorded
- See Also:
Location
setLocation
public void setLocation(Location location)
- Specified by:
setLocation
in interface SensorData
- Parameters:
location
- the location at which the data set will be recorded
setTimeStamp
public void setTimeStamp(java.sql.Timestamp timeStamp)
- Specified by:
setTimeStamp
in interface SensorData
- Parameters:
timeStamp
- sets the time stamp when a data set was recorded- See Also:
Timestamp