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

Package class diagram package SensorObservation
Type Parameters:
T - the enumeration type for the dimensions
U - the data type for the dimension values
All Superinterfaces:
DeviceData, ObservableEvent
All Known Implementing Classes:
AbstractSensorObservation, AccSensorObservationImpl, SensorObservationImpl

public interface SensorObservation<T extends Enum<T> & Dimensions,U>
extends ObservableEvent, DeviceData

Generic interface for a sensor observation, which contains a time stamp and sensor values for a given sensor value dimension type.


Method Summary
 SensorObservation<T,U> cloneWithTimeStamp(long ts)
          Does clone a sensor observation with the given time stamp.
 U get(T dim)
          Getter for the value of a specific dimension
 T[] getDimensions()
          Getter for the dimensions types
 Long getTimeStamp()
          Getter for the time stamp.
 U[] getValues()
          Getter for the values.
 boolean hasEqualValues(SensorObservation<T,U> observation)
          Test method for equal values
 void set(T dim, U value)
          Setter for the value of a specific dimension
 void setTimeStamp(long ts)
          Setter for the time stamp.
 

Method Detail

getDimensions

T[] getDimensions()
Getter for the dimensions types

Returns:
the dimensions type array

get

U get(T dim)
Getter for the value of a specific dimension

Parameters:
dim - the dimension identifier
Returns:
the value for the given dimension

set

void set(T dim,
         U value)
Setter for the value of a specific dimension

Parameters:
dim - the dimension identifier
value - the value for the given dimension

getTimeStamp

Long getTimeStamp()
Getter for the time stamp.

Returns:
the time stamp in milliseconds

getValues

U[] getValues()
Getter for the values.

Returns:
the array with the values

setTimeStamp

void setTimeStamp(long ts)
Setter for the time stamp.

Parameters:
ts - the time stamp to set

hasEqualValues

boolean hasEqualValues(SensorObservation<T,U> observation)
Test method for equal values

Parameters:
observation - the sensor observation to compare values with
Returns:
true if values are equal, false other wise

cloneWithTimeStamp

SensorObservation<T,U> cloneWithTimeStamp(long ts)
Does clone a sensor observation with the given time stamp.

Parameters:
ts - the time stamp of the cloned observation
Returns:
a clone of this observation with the given time stamp