org.android.activityminer.model.timeseries
Interface SensorObservationCutout<T extends Enum<T> & Dimensions,U>

Package class diagram package SensorObservationCutout
Type Parameters:
T - the enumeration type for the dimensions
U - the data type for the dimension values
All Superinterfaces:
ObservableEvent, SerializableData
All Known Implementing Classes:
SensorObservationCutoutImpl

public interface SensorObservationCutout<T extends Enum<T> & Dimensions,U>
extends SerializableData, ObservableEvent

Interface for sensor observation cut-out types.


Method Summary
 void addObservation(SensorObservation<T,U> observation)
          Method to add a sensor observation to this type.
 void addObservations(List<? extends SensorObservation<T,U>> observations)
          Method to add a sample collection to this type.
 void clear()
          Method to clear the current content.
 void cutBeforeTime(long startTimeStamp)
          Method to cut the cut-out by removing all observations younger than the given time stamp.
 List<U> getDimensionValues(T dimension)
          Getter for the values of a specific dimension.
 U[] getDimensionValuesAsArray(T dimension)
          Getter for the values of a specific dimension as array.
 long getDuration()
          Getter for the duration of the sensor observation series.
 SensorObservation<T,U> getSensorObservation(int pos)
          Getter for the sensor observations at a given position.
 List<SensorObservation<T,U>> getSensorObservations()
          Getter for the sensor observations.
 List<SensorObservation<T,U>> getSensorObservations(int startPos, int cnt)
          Getter for the given count of sensor observations from a given start position.
 long getStartTime()
          getter for the start time
 Long getTimeStamp(int index)
          Getter for the time stamp at the given index.
 List<Long> getTimeStamps()
          Getter for the time stamps of the sensor observation series.
 Long[] getTimeStampsAsArray()
          Getter for the time stamps the sensor observation series as Array.
 U getValue(T dimension, int index)
          Getter for a single sensor value of a specific dimension at the given index.
 int size()
          Getter for the frame size ( current sample count in this frame ).
 void truncateAfterTime(long maxTimeStamp)
          Method to truncate the cut-out by removing all observations older than the given time stamp.
 
Methods inherited from interface de.unikassel.android.sdcframework.data.independent.SerializableData
toXML
 

Method Detail

size

int size()
Getter for the frame size ( current sample count in this frame ).

Returns:
the size of this frame

getDimensionValues

List<U> getDimensionValues(T dimension)
Getter for the values of a specific dimension.

Parameters:
dimension - the requested dimension
Returns:
the values in a list

getDimensionValuesAsArray

U[] getDimensionValuesAsArray(T dimension)
Getter for the values of a specific dimension as array.

Parameters:
dimension - the requested dimension
Returns:
the values as array

getValue

U getValue(T dimension,
           int index)
Getter for a single sensor value of a specific dimension at the given index.

Parameters:
dimension - the requested sensor observation dimension
index - the index position in the time series of sensor observations
Returns:
the value for the given dimension and index if exists, null otherwise

getTimeStamps

List<Long> getTimeStamps()
Getter for the time stamps of the sensor observation series.

Returns:
the series time stamps as list

getTimeStamp

Long getTimeStamp(int index)
Getter for the time stamp at the given index.

Parameters:
index - the index position in the time series of sensor observations
Returns:
the time stamp at the given index if exists, null otherwise

getDuration

long getDuration()
Getter for the duration of the sensor observation series. The duration is the difference between the time stamps of the last and the first sensor observation.

Returns:
the duration of the series

getTimeStampsAsArray

Long[] getTimeStampsAsArray()
Getter for the time stamps the sensor observation series as Array.

Returns:
the series time stamps as array

getSensorObservations

List<SensorObservation<T,U>> getSensorObservations()
Getter for the sensor observations.

Returns:
the sensor observations

getSensorObservations

List<SensorObservation<T,U>> getSensorObservations(int startPos,
                                                   int cnt)
Getter for the given count of sensor observations from a given start position.

Parameters:
startPos - the start position
cnt - the count
Returns:
the sensor observations

getSensorObservation

SensorObservation<T,U> getSensorObservation(int pos)
Getter for the sensor observations at a given position.

Parameters:
pos - the position
Returns:
the sensor observation

addObservation

void addObservation(SensorObservation<T,U> observation)
Method to add a sensor observation to this type.

Parameters:
observation - the observation to add

addObservations

void addObservations(List<? extends SensorObservation<T,U>> observations)
Method to add a sample collection to this type.

Parameters:
observations - the observations to add

clear

void clear()
Method to clear the current content.


truncateAfterTime

void truncateAfterTime(long maxTimeStamp)
Method to truncate the cut-out by removing all observations older than the given time stamp.

Parameters:
maxTimeStamp - the maximum time stamp to truncate for

cutBeforeTime

void cutBeforeTime(long startTimeStamp)
Method to cut the cut-out by removing all observations younger than the given time stamp.

Parameters:
startTimeStamp - the new minimum time stamp to set as start time

getStartTime

long getStartTime()
getter for the start time

Returns:
the start time stamp