public class SimpleTileFetcher extends android.os.HandlerThread implements TileFetcher
| Modifier and Type | Class and Description |
|---|---|
protected class |
SimpleTileFetcher.SimpleTileFetchInfo
No remote URLs to track, so we just keep the
tile ID.
|
class |
SimpleTileFetcher.SimpleTileInfo
We don't need to describe a remote URL, so this is
basically a stub that passes back the tile ID.
|
class |
SimpleTileFetcher.TileInfo
Wrapper around the fetch request so we can prioritize loads.
|
| Modifier and Type | Field and Description |
|---|---|
int |
maxZoom |
int |
minZoom |
protected java.lang.String |
name |
protected boolean |
neverFail |
protected java.util.Queue<android.os.AsyncTask<java.lang.Void,java.lang.Void,java.lang.Void>> |
tasks |
protected SimpleTileFetcher.SimpleTileInfo |
tileInfo |
protected boolean |
valid |
| Constructor and Description |
|---|
SimpleTileFetcher(java.lang.String inName)
Construct with the name, min and max zoom levels.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancelTileFetches(java.lang.Object[] fetches)
Cancel a group of requests at once
Use the object returned by the startTileFetch call (which is just a Request object)
|
byte[] |
dataForTile(java.lang.Object fetchInfo,
TileID tileID)
Fill this in in your subclass.
|
protected void |
finishTile(SimpleTileFetcher.TileInfo tileInfo) |
java.lang.String |
getFetcherName()
Name of this tile fetcher.
|
SimpleTileFetcher.SimpleTileInfo |
getTileInfo()
The tile info is used by the quad paging logic to figure out
min/max zoom level and such.
|
protected void |
scheduleLoading() |
void |
shutdown()
Kill all outstanding connections and clean up.
|
void |
startTileFetches(TileFetchRequest[] requests)
Add a bunch of requests to the queue and kick them off in a tick.
|
protected void |
updateLoading() |
protected void |
updateTasks() |
java.lang.Object |
updateTileFetch(java.lang.Object fetchRequest,
int priority,
float importance)
Update an active request with a new priority and importance.
|
getLooper, getThreadId, onLooperPrepared, quit, quitSafely, runactiveCount, 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, start, stop, stop, suspend, toString, yieldprotected boolean valid
protected java.lang.String name
public int minZoom
public int maxZoom
protected SimpleTileFetcher.SimpleTileInfo tileInfo
protected java.util.Queue<android.os.AsyncTask<java.lang.Void,java.lang.Void,java.lang.Void>> tasks
protected boolean neverFail
public SimpleTileFetcher(java.lang.String inName)
public SimpleTileFetcher.SimpleTileInfo getTileInfo()
public java.lang.String getFetcherName()
getFetcherName in interface TileFetcherpublic void startTileFetches(TileFetchRequest[] requests)
startTileFetches in interface TileFetcherprotected void scheduleLoading()
protected void updateLoading()
protected void updateTasks()
protected void finishTile(SimpleTileFetcher.TileInfo tileInfo)
public java.lang.Object updateTileFetch(java.lang.Object fetchRequest,
int priority,
float importance)
updateTileFetch in interface TileFetcherpublic void cancelTileFetches(java.lang.Object[] fetches)
cancelTileFetches in interface TileFetcherpublic void shutdown()
shutdown in interface TileFetcherpublic byte[] dataForTile(java.lang.Object fetchInfo,
TileID tileID)