|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.android.activityminer.logic.util.AbstractActivatableComponentImpl
org.android.activityminer.logic.devices.LocationDataCache
public class LocationDataCache
The data cache to hold location samples for scanner polls.
Field Summary | |
---|---|
protected ConcurrentLinkedQueue<NetworkLocationData> |
cache
The sample cache. |
private NetworkLocationData |
lastSample
Last sample. |
Constructor Summary | |
---|---|
LocationDataCache()
Constructor |
Method Summary | |
---|---|
void |
add(double lon,
double lat,
double speed,
long ts)
Does add a new sample to the cache. |
void |
add(Location currentData,
long ts)
Does add a new sample to the cache. |
protected boolean |
hasSample()
Test method for valid samples |
protected void |
onActivationStateChange(boolean active)
Handler for activation state changes |
void |
onDestroy()
This method is for cleanup in case of termination. |
NetworkLocationData |
takeSample(Long ts)
Getter for the current sample |
Methods inherited from class org.android.activityminer.logic.util.AbstractActivatableComponentImpl |
---|
isActive, setActivationState |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private NetworkLocationData lastSample
protected final ConcurrentLinkedQueue<NetworkLocationData> cache
Constructor Detail |
---|
public LocationDataCache()
Method Detail |
---|
public final NetworkLocationData takeSample(Long ts)
SensorDataSource
takeSample
in interface SensorDataSource<NetworkLocationData>
ts
- the requested time stamp
public final void onDestroy()
SensorDataSource
onDestroy
in interface SensorDataSource<NetworkLocationData>
protected final boolean hasSample()
protected final void onActivationStateChange(boolean active)
AbstractActivatableComponentImpl
onActivationStateChange
in class AbstractActivatableComponentImpl
active
- the new activation statepublic final void add(Location currentData, long ts)
currentData
- the location data to addts
- the original sample time stamppublic final void add(double lon, double lat, double speed, long ts)
lon
- the longitudelat
- the latitudespeed
- the speedts
- the original time stamp
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |