|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unikassel.android.sdcframework.util.ObservableEventSourceImpl<SensorObservation<T,U>>
org.android.activityminer.logic.timeseries.AbstractObservableSensorScanner<T,U>
T
- the enumeration type for the dimensionsU
- the data type for the dimension valuespublic abstract class AbstractObservableSensorScanner<T extends Enum<T> & Dimensions,U>
Generic and abstract implementation of an observable sensor scanner.
Field Summary | |
---|---|
private ActivatableComponent |
activationDelegation
activatable component implementation to delegate to |
private LooperThread |
looperThread
The looper tread with the associated handler. |
private TimerTask |
timerTask
The timer task for sensor observation. |
Constructor Summary | |
---|---|
AbstractObservableSensorScanner(long sampleRate,
long initialDelay)
Constructor |
Method Summary | |
---|---|
boolean |
doScan(Long ts)
Method to trigger the scanning of connected data sources. |
void |
doTerminate()
Does terminate the associated thread. |
long |
getFrequency()
Getter for the sample frequency in milliseconds |
protected abstract SensorObservation<T,U> |
getNewSensorObservation(Long ts)
Does take samples from sources and creates a new sensor observation. |
private TimerTask |
getTimerTask(long samplingFrequency,
LooperThread looperThread,
long initialDelay)
Getter for the timer task |
boolean |
isActive()
Test method for the actiation state. |
protected void |
onActivationStateChange(boolean active)
Handler for activation state changes |
void |
setActivationState(boolean active)
Method to set the activation state of the component |
protected void |
setInitilized()
Must be called in Constructor of extending classes when construction is finished |
Methods inherited from class de.unikassel.android.sdcframework.util.ObservableEventSourceImpl |
---|
getObservers, hasObservers, notify, onObserverRegistration, onObserverUnregistration, registerEventObserver, removeAllObservers, unregisterEventObserver |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.android.activityminer.logic.timeseries.ObservableSensorScanner |
---|
getAccSource |
Methods inherited from interface org.android.activityminer.logic.timeseries.SensorScanner |
---|
delegateNotify |
Methods inherited from interface de.unikassel.android.sdcframework.util.facade.ObservableEventSource |
---|
hasObservers, notify |
Methods inherited from interface de.unikassel.android.sdcframework.util.facade.ObserverRegistration |
---|
registerEventObserver, removeAllObservers, unregisterEventObserver |
Field Detail |
---|
private final ActivatableComponent activationDelegation
private final TimerTask timerTask
private final LooperThread looperThread
Constructor Detail |
---|
public AbstractObservableSensorScanner(long sampleRate, long initialDelay)
sampleRate
- the rate in milliseconds samples are taken withinitialDelay
- the initial start delayMethod Detail |
---|
private final TimerTask getTimerTask(long samplingFrequency, LooperThread looperThread, long initialDelay)
samplingFrequency
- the frequency in milliseconds samples are taken withlooperThread
- the looper thread to useinitialDelay
- the initial delay
protected void setInitilized()
public final void setActivationState(boolean active)
ActivatableComponent
setActivationState
in interface ActivatableComponent
active
- the activation sate flagpublic final boolean isActive()
ActivatableComponent
isActive
in interface ActivatableComponent
protected void onActivationStateChange(boolean active)
active
- the new activation statepublic final void doTerminate()
ObservableSensorScanner
doTerminate
in interface ObservableSensorScanner<T extends Enum<T> & Dimensions,U>
public final boolean doScan(Long ts)
SensorScanner
doScan
in interface SensorScanner
ts
- the requested time stamp
protected abstract SensorObservation<T,U> getNewSensorObservation(Long ts)
ts
- the time stamp for the observation
public final long getFrequency()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |