|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.android.activityminer.logic.util.SequenceTimeGapResampler<T>
T
- the enumeration type for the dimensionspublic class SequenceTimeGapResampler<T extends Enum<T> & Dimensions>
Resampler for the occasional gaps in older stored time series sequences.
Field Summary | |
---|---|
private SensorObservationCache<T,Double> |
cache
The sensor observation cache. |
private long |
maxFrameSize
The maximum frame size of stored recordings. |
private long |
sampleRate
The sample rate of the recordings. |
Constructor Summary | |
---|---|
SequenceTimeGapResampler(long sampleRate)
Constructor |
Method Summary | |
---|---|
private void |
fillWithRequiredObservationsFromNextRecording(LabeledRecording<T> nextRecording,
List<SensorObservation<T,Double>> observations,
long endTs)
Does add required samples from next recording to full fill end time requirement. |
void |
finishSequence()
Does stop a sequence processing. |
long |
getMaxFrameSize()
Getter for the maximum frame size |
long |
getSampleRate()
Getter for the sample rate |
SensorObservationCutout<T,Double> |
resample(LabeledRecording<T> recording,
LabeledRecording<T> nextRecording,
AtomicLong nextSampleTs)
Does re-sample the cut-out for the database frequency to fix the known gaps in older time series. |
SensorObservationCutout<T,Double> |
resampleFromCache(AtomicLong nextSampleTs,
long minDuration)
Test for remaining observations in the cache for further cut-outs |
void |
startSequence()
Does start sequence processing. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final long sampleRate
private final SensorObservationCache<T extends Enum<T> & Dimensions,Double> cache
private final long maxFrameSize
Constructor Detail |
---|
public SequenceTimeGapResampler(long sampleRate)
sampleRate
- the sample rateMethod Detail |
---|
public long getMaxFrameSize()
public long getSampleRate()
public final void startSequence()
public final void finishSequence()
public final SensorObservationCutout<T,Double> resample(LabeledRecording<T> recording, LabeledRecording<T> nextRecording, AtomicLong nextSampleTs)
recording
- the cut-outnextRecording
- the last observation (null if record is the first in the sequence)nextSampleTs
- the time stamp of the next sample to take
private void fillWithRequiredObservationsFromNextRecording(LabeledRecording<T> nextRecording, List<SensorObservation<T,Double>> observations, long endTs)
nextRecording
- the next recordingobservations
- the current observation list to add required observations toendTs
- the end time stamppublic final SensorObservationCutout<T,Double> resampleFromCache(AtomicLong nextSampleTs, long minDuration)
nextSampleTs
- the next Sample time stampminDuration
- the minimum duration
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |