|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
de.unikassel.android.sdcframework.util.AbstractWorkerThread
de.unikassel.android.sdcframework.util.AbstractEventDispatcherImpl<SensorObservationCutout<T,Double>,FeatureVector>
org.android.activityminer.logic.features.AbstractFeatureExtractor<T>
T
- the enumeration type for the dimensionspublic abstract class AbstractFeatureExtractor<T extends Enum<T> & Dimensions>
The feature extractor for sensor observations is a thread based component. It
can be attached to an observable source for sensor observation cut-outs.
Incoming cut-outs are cache in an internal Thread-safe queue.
On activation the thread removes the cut-outs one by one from the queue and
features will be extracted. The created feature vectors will be notified to
registered observers.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
private ActivatableComponent |
activationDelegation
activatable component implementation to delegate to |
private Context |
context
The context. |
private FeatureExtractionConfiguration<T> |
featureConfiguration
The feature configuration composed of the features and the associated shared calculators. |
private AtomicBoolean |
isExtracting
Flag if the thread is active while extracting samples. |
private List<ObservationBasedCalulator<T>> |
observationBasedCalculators
The list of the observationBasedCalculators for feature extraction. |
private AtomicLong |
totalExtractionTimeNeeded
The total time needed for extraction. |
Fields inherited from class de.unikassel.android.sdcframework.util.AbstractEventDispatcherImpl |
---|
collector |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
AbstractFeatureExtractor(FeatureTypes[] featureTypes,
long sampleRate,
Context context)
Constructor |
Method Summary | |
---|---|
protected void |
doWork()
|
void |
featureTypeConfiguration(FeatureTypes[] featureTypes,
long sampleRate)
Configuration method. |
double |
getExtractionTime()
Getter for the time to extract the features from cut-outs. |
protected abstract AbstractFeatureFactory<T> |
getFactory(Context context)
Getter for the feature factory |
protected int |
getQueuedCutoutCount()
Getter for the remaining count of queued cut-outs. |
boolean |
isActive()
Test method for the actiation state. |
protected boolean |
isEctracting()
Test method if the extractor is active while extracting features. |
protected void |
onActivationStateChange(boolean active)
Handler for activation state changes |
void |
onDestroy()
Destruction. |
void |
setActivationState(boolean active)
Method to set the activation state of the component |
Methods inherited from class de.unikassel.android.sdcframework.util.AbstractEventDispatcherImpl |
---|
doCleanUp, getCollector, getEventSource, hasObservers, notify, registerEventObserver, removeAllObservers, unregisterEventObserver |
Methods inherited from class de.unikassel.android.sdcframework.util.AbstractWorkerThread |
---|
doTerminate, hasTerminated, isLogging, isWorking, logMessage, run, setLogging, start, startWork, stopWork |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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 |
Methods inherited from interface de.unikassel.android.sdcframework.util.facade.WorkerThread |
---|
doTerminate, hasTerminated, isLogging, isWorking, setLogging, startWork, stopWork |
Field Detail |
---|
private final ActivatableComponent activationDelegation
private final AtomicBoolean isExtracting
private final AtomicLong totalExtractionTimeNeeded
private final List<ObservationBasedCalulator<T extends Enum<T> & Dimensions>> observationBasedCalculators
private FeatureExtractionConfiguration<T extends Enum<T> & Dimensions> featureConfiguration
private final Context context
Constructor Detail |
---|
public AbstractFeatureExtractor(FeatureTypes[] featureTypes, long sampleRate, Context context)
featureTypes
- the types of the features to extract from the time series datasampleRate
- the configured sample ratecontext
- the contextMethod Detail |
---|
public void featureTypeConfiguration(FeatureTypes[] featureTypes, long sampleRate)
featureTypes
- the feature types for configurationsampleRate
- the configured sample rateprotected abstract AbstractFeatureFactory<T> getFactory(Context context)
context
- the context
protected void onActivationStateChange(boolean active)
active
- the new activation statepublic final void setActivationState(boolean active)
ActivatableComponent
setActivationState
in interface ActivatableComponent
active
- the activation sate flagpublic final boolean isActive()
ActivatableComponent
isActive
in interface ActivatableComponent
public void onDestroy()
protected final int getQueuedCutoutCount()
protected final void doWork()
doWork
in class AbstractWorkerThread
public final double getExtractionTime()
protected boolean isEctracting()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |