de.Android_Seminar.backend.impl
Class DataBuffer

java.lang.Object
  extended by de.Android_Seminar.backend.impl.DataBuffer

public class DataBuffer
extends java.lang.Object

A Buffer that stores data, delivered from a sensor.

Author:
jonas

Constructor Summary
DataBuffer(int dataSetNumber, int dataSetLength, SensorType sensor)
           
 
Method Summary
 void addData(SensorData data)
           
 void clear()
          clears the buffer
 SensorData getData()
           
 SensorData[] getData(int amount)
           
 SensorType getSensorType()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataBuffer

public DataBuffer(int dataSetNumber,
                  int dataSetLength,
                  SensorType sensor)
Parameters:
dataSetNumber - the number of data sets a buffers should be able to hold
dataSetLength - 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
Method Detail

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