com.sony.csl.j2me.locationapitools
Class CoordinatesCache
java.lang.Object
com.sony.csl.j2me.locationapitools.CoordinatesCache
- All Implemented Interfaces:
- LocationProxyListener
public class CoordinatesCache
- extends java.lang.Object
- implements LocationProxyListener
- Author:
- mstevens
Method Summary |
void |
firstLocationFound(LocationProxy proxy,
LocationProvider provider,
Location location)
|
Coordinates[] |
getAllCoordinatesBetween(long begin,
long end)
|
Coordinates[] |
getAllCoordinatesBetween(long begin,
long end,
boolean inclusive)
|
java.util.Vector |
getCache()
|
Coordinates |
getCoordinatesClosestTo(long timeStamp)
|
Coordinates |
getCoordinatesJustAfter(long timeStamp)
|
Coordinates |
getCoordinatesJustAfterOrAt(long timeStamp)
|
Coordinates |
getCoordinatesJustBefore(long timeStamp)
|
Coordinates |
getCoordinatesJustBeforeOrAt(long timeStamp)
|
Coordinates |
getNewestCoordinates()
|
Coordinates |
getOldestCoordinates()
|
boolean |
isEmpty()
|
void |
locationProviderStateChanged(LocationProxy proxy,
LocationProvider provider,
int newState)
|
void |
locationUpdated(LocationProxy proxy,
LocationProvider provider,
Location location)
|
void |
proxyConnected(LocationProxy proxy,
LocationProvider provider)
|
void |
proxyDisconnected(LocationProxy proxy)
|
private void |
purgeOldCoordinates()
|
boolean |
receivesInvalidLocations()
|
int |
size()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
cache
private java.util.Vector cache
lastLocationTimeStamp
private long lastLocationTimeStamp
retentionTimeMilliSeconds
private int retentionTimeMilliSeconds
CoordinatesCache
public CoordinatesCache(LocationProxy locationProxy,
int retentionTimeSeconds)
firstLocationFound
public void firstLocationFound(LocationProxy proxy,
LocationProvider provider,
Location location)
- Specified by:
firstLocationFound
in interface LocationProxyListener
locationProviderStateChanged
public void locationProviderStateChanged(LocationProxy proxy,
LocationProvider provider,
int newState)
- Specified by:
locationProviderStateChanged
in interface LocationProxyListener
locationUpdated
public void locationUpdated(LocationProxy proxy,
LocationProvider provider,
Location location)
- Specified by:
locationUpdated
in interface LocationProxyListener
purgeOldCoordinates
private void purgeOldCoordinates()
proxyConnected
public void proxyConnected(LocationProxy proxy,
LocationProvider provider)
- Specified by:
proxyConnected
in interface LocationProxyListener
proxyDisconnected
public void proxyDisconnected(LocationProxy proxy)
- Specified by:
proxyDisconnected
in interface LocationProxyListener
receivesInvalidLocations
public boolean receivesInvalidLocations()
- Specified by:
receivesInvalidLocations
in interface LocationProxyListener
getCache
public java.util.Vector getCache()
isEmpty
public boolean isEmpty()
size
public int size()
getOldestCoordinates
public Coordinates getOldestCoordinates()
getNewestCoordinates
public Coordinates getNewestCoordinates()
getCoordinatesJustBefore
public Coordinates getCoordinatesJustBefore(long timeStamp)
getCoordinatesJustBeforeOrAt
public Coordinates getCoordinatesJustBeforeOrAt(long timeStamp)
getCoordinatesJustAfter
public Coordinates getCoordinatesJustAfter(long timeStamp)
getCoordinatesJustAfterOrAt
public Coordinates getCoordinatesJustAfterOrAt(long timeStamp)
getCoordinatesClosestTo
public Coordinates getCoordinatesClosestTo(long timeStamp)
getAllCoordinatesBetween
public Coordinates[] getAllCoordinatesBetween(long begin,
long end)
getAllCoordinatesBetween
public Coordinates[] getAllCoordinatesBetween(long begin,
long end,
boolean inclusive)