de.Android_Seminar.backend.impl
Class DataBuffer
java.lang.Object
de.Android_Seminar.backend.impl.DataBuffer
public class DataBuffer
- extends java.lang.Object
A Buffer that stores data, delivered from a sensor.
- Author:
- jonas
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DataBuffer
public DataBuffer(int dataSetNumber,
int dataSetLength,
SensorType sensor)
- Parameters:
dataSetNumber
- the number of data sets a buffers should be able to holddataSetLength
- the number of values one data set holds.sensor
- the sensor type of the sensor that stores values in this buffer- See Also:
SensorData
,
SensorType
addData
public void addData(SensorData data)
getData
public SensorData getData()
- Returns:
- the newest data set from the buffer or null if the buffer is empty
getData
public SensorData[] getData(int amount)
- Returns:
- all the data, contained in the buffer
getSensorType
public SensorType getSensorType()
- Returns:
- the sensor type for which data can be saved in this buffer
- See Also:
SensorType
clear
public void clear()
- clears the buffer