|
||||||||||
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
org.android.activityminer.app.util.ObservableWorkerThreadWithProgressNotification
org.android.activityminer.logic.features.FeatureExtractionThread<T>
T
- the enumeration type for the dimensionspublic class FeatureExtractionThread<T extends Enum<T> & Dimensions>
The feature extraction thread.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
private double |
avgTimeForFeatureExtraction
The average extraction time per cut-out. |
private Context |
context
The activity context. |
private int |
extractedSampleCount
The count of extracted samples. |
private List<Long> |
failedIds
The recoding identifiers which failed to process. |
private static int |
FEATURE_EXTRACTION_NOTIFICATION
the feature extraction notification identifier |
private FeatureExtractionHelper<T> |
helper
Helper to delegate feature extraction to |
private double |
processingTime
The total processing time in seconds. |
private long[] |
sequenceIds
The continuous recoding sequence identifiers to process. |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
private |
FeatureExtractionThread(Context context,
long[] sequenceIds,
FeatureExtractionHelper<T> featureExtractionHelper,
Class<? extends Activity> intentReceiver)
Constructor |
Method Summary | |
---|---|
static ObservableWorkerThreadWithProgressNotification |
create(Context context,
DBManager dbManager,
Configuration config,
long[] sequenceIds,
boolean hasToAdaptToConfiguration,
EventObserver<TaskFinishedEvent> finishedObserver,
Class<? extends Activity> intentReceiver)
Does create a feature extraction thread for the given configuration and recording identifiers. |
static ObservableWorkerThreadWithProgressNotification |
createAndRun(Context context,
DBManager dbManager,
Configuration config,
long[] sequenceIds,
boolean hasToAdaptToConfiguration,
EventObserver<TaskFinishedEvent> finishedObserver,
Class<? extends Activity> intentReceiver)
Does create and execute a feature extraction thread for the given configuration and recording identifiers. |
protected void |
doWork()
|
String |
getErrorNotificationMsg()
Getter for the error notification message |
int |
getNotificationId()
Getter for the notification identifier |
String |
getResultNotificationMsg()
Getter for the result notification message |
boolean |
hasSucceeded()
Test method for success in case of termination |
void |
onEvent(ObservableEventSource<? extends FeatureExtractionHelper.ProgressEvent> eventSource,
FeatureExtractionHelper.ProgressEvent observedEvent)
|
Methods inherited from class org.android.activityminer.app.util.ObservableWorkerThreadWithProgressNotification |
---|
broadcastProgress, doCleanUp, getApplicationContext, getFinalResult, getMaxProgress, getNotification, getTaskTitle, hasObservers, incrementAndNotifyProgress, incrementAndNotifyProgress, notify, notifyProgress, notifyProgress, registerEventObserver, removeAllObservers, setMaxProgress, 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 |
Field Detail |
---|
private static final int FEATURE_EXTRACTION_NOTIFICATION
private final Context context
private final FeatureExtractionHelper<T extends Enum<T> & Dimensions> helper
private final long[] sequenceIds
private final List<Long> failedIds
private double avgTimeForFeatureExtraction
private int extractedSampleCount
private double processingTime
Constructor Detail |
---|
private FeatureExtractionThread(Context context, long[] sequenceIds, FeatureExtractionHelper<T> featureExtractionHelper, Class<? extends Activity> intentReceiver)
context
- the application contextsequenceIds
- a list with the sequence identifiers to processfeatureExtractionHelper
- the feature extraction helperintentReceiver
- the intent receiver classMethod Detail |
---|
public final String getErrorNotificationMsg()
ObservableWorkerThreadWithProgressNotification
getErrorNotificationMsg
in class ObservableWorkerThreadWithProgressNotification
public final String getResultNotificationMsg()
ObservableWorkerThreadWithProgressNotification
getResultNotificationMsg
in class ObservableWorkerThreadWithProgressNotification
public final int getNotificationId()
ObservableWorkerThreadWithProgressNotification
getNotificationId
in class ObservableWorkerThreadWithProgressNotification
public final boolean hasSucceeded()
ObservableWorkerThreadWithProgressNotification
hasSucceeded
in class ObservableWorkerThreadWithProgressNotification
protected final void doWork()
doWork
in class AbstractWorkerThread
public static final ObservableWorkerThreadWithProgressNotification createAndRun(Context context, DBManager dbManager, Configuration config, long[] sequenceIds, boolean hasToAdaptToConfiguration, EventObserver<TaskFinishedEvent> finishedObserver, Class<? extends Activity> intentReceiver)
context
- the context of the callerdbManager
- the database manager to useconfig
- the configuration to usesequenceIds
- the list with the continuous recoding sequence identifiers to
processhasToAdaptToConfiguration
- flag if adaption is required (can only happen in batch export
mode)finishedObserver
- the finished event observerintentReceiver
- the intent receiver class
public static ObservableWorkerThreadWithProgressNotification create(Context context, DBManager dbManager, Configuration config, long[] sequenceIds, boolean hasToAdaptToConfiguration, EventObserver<TaskFinishedEvent> finishedObserver, Class<? extends Activity> intentReceiver)
context
- the context of the callerdbManager
- the database manager to useconfig
- the configuration to usesequenceIds
- the list with the continuous recoding sequence identifiers to
processhasToAdaptToConfiguration
- flag if adaption is required (can only happen in batch export
mode)finishedObserver
- the finished event observerintentReceiver
- the intent receiver class
public void onEvent(ObservableEventSource<? extends FeatureExtractionHelper.ProgressEvent> eventSource, FeatureExtractionHelper.ProgressEvent observedEvent)
onEvent
in interface EventObserver<FeatureExtractionHelper.ProgressEvent>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |