Class PlaceNameLayerBulkDownloader
- java.lang.Object
-
- java.lang.Thread
-
- gov.nasa.worldwind.retrieve.BulkRetrievalThread
-
- gov.nasa.worldwind.layers.placename.PlaceNameLayerBulkDownloader
-
- All Implemented Interfaces:
java.lang.Runnable
public class PlaceNameLayerBulkDownloader extends BulkRetrievalThread
Downloads placenames not currently available in the WorldWind file cache or a specifiedFileStore. The class derives fromThreadand is meant to operate in its own thread.The sector and resolution associated with the downloader are specified during construction and are final.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classPlaceNameLayerBulkDownloader.BulkDownloadPostProcessor
-
Field Summary
Fields Modifier and Type Field Description protected static longAVG_TILE_SIZEprotected PlaceNameLayerlayerprotected intMAX_TILE_COUNT_PER_REGIONprotected java.util.ArrayList<PlaceNameLayer.Tile>missingTilesprotected longpollDelay-
Fields inherited from class gov.nasa.worldwind.retrieve.BulkRetrievalThread
fileStore, progress, resolution, retrievable, RETRIEVAL_SERVICE_POLL_DELAY, retrievalListeners, sector
-
-
Constructor Summary
Constructors Constructor Description PlaceNameLayerBulkDownloader(PlaceNameLayer layer, Sector sector, double resolution, FileStore fileStore, BulkRetrievalListener listener)Constructs a downloader to retrieve placenames not currently available in a specified file store and places it there.PlaceNameLayerBulkDownloader(PlaceNameLayer layer, Sector sector, double resolution, BulkRetrievalListener listener)Constructs a downloader to retrieve placenames not currently available in the WorldWind file cache.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcallRetrievalListeners(Retriever retriever, PlaceNameLayer.Tile tile)protected intestimateNumberTilesinSector(PlaceNameLayer.NavigationTile tile, Sector searchSector)protected longgetEstimatedMissingDataSize()protected intgetMissingTilesCountEstimate(Sector sector, double resolution)protected java.util.ArrayList<PlaceNameLayer.Tile>getMissingTilesInSector(Sector sector)protected booleanisTileLocalOrAbsent(PlaceNameLayer.Tile tile)protected java.util.List<PlaceNameLayer.NavigationTile>navTilesVisible(PlaceNameLayer.NavigationTile tile, Sector sector)protected voidremoveRetrievedTile(PlaceNameLayer.Tile tile)voidrun()protected voidsubmitMissingTilesRequests()protected voidtransferMissingTiles(java.util.ArrayList<PlaceNameLayer.Tile> source, java.util.ArrayList<PlaceNameLayer.Tile> destination, int maxCount)-
Methods inherited from class gov.nasa.worldwind.retrieve.BulkRetrievalThread
addRetrievalListener, callRetrievalListeners, getFileStore, getProgress, getResolution, getRetrievable, getSector, hasRetrievalListeners, removeRetrievalListener
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, toString, yield
-
-
-
-
Field Detail
-
AVG_TILE_SIZE
protected static final long AVG_TILE_SIZE
- See Also:
- Constant Field Values
-
MAX_TILE_COUNT_PER_REGION
protected int MAX_TILE_COUNT_PER_REGION
-
layer
protected final PlaceNameLayer layer
-
missingTiles
protected java.util.ArrayList<PlaceNameLayer.Tile> missingTiles
-
pollDelay
protected long pollDelay
-
-
Constructor Detail
-
PlaceNameLayerBulkDownloader
public PlaceNameLayerBulkDownloader(PlaceNameLayer layer, Sector sector, double resolution, BulkRetrievalListener listener)
Constructs a downloader to retrieve placenames not currently available in the WorldWind file cache.The thread returned is not started during construction, the caller must start the thread.
- Parameters:
layer- the layer for which to download placenames.sector- the sector to download data for. This value is final.resolution- the target resolution, provided in radians of latitude per texel. This value is final.listener- an optional retrieval listener. May be null.- Throws:
java.lang.IllegalArgumentException- if either the layer or sector are null, or the resolution is less than zero.
-
PlaceNameLayerBulkDownloader
public PlaceNameLayerBulkDownloader(PlaceNameLayer layer, Sector sector, double resolution, FileStore fileStore, BulkRetrievalListener listener)
Constructs a downloader to retrieve placenames not currently available in a specified file store and places it there.The thread returned is not started during construction, the caller must start the thread.
- Parameters:
layer- the layer for which to download placenames.sector- the sector to download data for. This value is final.resolution- the target resolution, provided in radians of latitude per texel. This value is final.fileStore- the file store in which to place the downloaded elevations.listener- an optional retrieval listener. May be null.- Throws:
java.lang.IllegalArgumentException- if either the layer, the sector or file store are null, or the resolution is less than zero.
-
-
Method Detail
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable- Specified by:
runin classBulkRetrievalThread
-
transferMissingTiles
protected void transferMissingTiles(java.util.ArrayList<PlaceNameLayer.Tile> source, java.util.ArrayList<PlaceNameLayer.Tile> destination, int maxCount)
-
submitMissingTilesRequests
protected void submitMissingTilesRequests() throws java.lang.InterruptedException- Throws:
java.lang.InterruptedException
-
callRetrievalListeners
protected void callRetrievalListeners(Retriever retriever, PlaceNameLayer.Tile tile)
-
removeRetrievedTile
protected void removeRetrievedTile(PlaceNameLayer.Tile tile)
-
getEstimatedMissingDataSize
protected long getEstimatedMissingDataSize()
-
getMissingTilesCountEstimate
protected int getMissingTilesCountEstimate(Sector sector, double resolution)
-
getMissingTilesInSector
protected java.util.ArrayList<PlaceNameLayer.Tile> getMissingTilesInSector(Sector sector) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
navTilesVisible
protected java.util.List<PlaceNameLayer.NavigationTile> navTilesVisible(PlaceNameLayer.NavigationTile tile, Sector sector)
-
estimateNumberTilesinSector
protected int estimateNumberTilesinSector(PlaceNameLayer.NavigationTile tile, Sector searchSector)
-
isTileLocalOrAbsent
protected boolean isTileLocalOrAbsent(PlaceNameLayer.Tile tile)
-
-