Package gov.nasa.worldwind.retrieve
Class BulkRetrievalThread
- java.lang.Object
-
- java.lang.Thread
-
- gov.nasa.worldwind.retrieve.BulkRetrievalThread
-
- All Implemented Interfaces:
java.lang.Runnable
- Direct Known Subclasses:
BasicElevationModelBulkDownloader,BasicTiledImageLayerBulkDownloader,PlaceNameLayerBulkDownloader
public abstract class BulkRetrievalThread extends java.lang.ThreadRetrieves data for aBulkRetrievable.
-
-
Field Summary
Fields Modifier and Type Field Description protected FileStorefileStoreprotected Progressprogressprotected doubleresolutionprotected BulkRetrievableretrievableprotected intRETRIEVAL_SERVICE_POLL_DELAYprotected javax.swing.event.EventListenerListretrievalListenersprotected Sectorsector
-
Constructor Summary
Constructors Constructor Description BulkRetrievalThread(BulkRetrievable retrievable, Sector sector, double resolution, FileStore fileStore, BulkRetrievalListener listener)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddRetrievalListener(BulkRetrievalListener listener)protected voidcallRetrievalListeners(BulkRetrievalEvent event)FileStoregetFileStore()Get the file store.ProgressgetProgress()Get aProgressinstance providing information about this task progress.doublegetResolution()Get the requested resolution.BulkRetrievablegetRetrievable()Get theBulkRetrievableinstance for which this thread acts.SectorgetSector()Get the requestedSector.protected booleanhasRetrievalListeners()voidremoveRetrievalListener(BulkRetrievalListener listener)abstract voidrun()-
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
-
RETRIEVAL_SERVICE_POLL_DELAY
protected int RETRIEVAL_SERVICE_POLL_DELAY
-
retrievable
protected final BulkRetrievable retrievable
-
sector
protected final Sector sector
-
resolution
protected final double resolution
-
progress
protected final Progress progress
-
fileStore
protected final FileStore fileStore
-
retrievalListeners
protected javax.swing.event.EventListenerList retrievalListeners
-
-
Constructor Detail
-
BulkRetrievalThread
public BulkRetrievalThread(BulkRetrievable retrievable, Sector sector, double resolution, FileStore fileStore, BulkRetrievalListener listener)
Construct a thread that attempts to download to a specifiedFileStorea retrievable's data for a givenSectorand resolution.This method creates and starts a thread to perform the download. A reference to the thread is returned. To create a downloader that has not been started, construct a
BasicElevationModelBulkDownloader.Note that the target resolution must be provided in radians of latitude per texel, which is the resolution in meters divided by the globe radius.
- Parameters:
retrievable- the retrievable to retrieve data for.sector- the sector of interest.resolution- the target resolution, provided in radians of latitude per texel.fileStore- the file store to examine.listener- an optional retrieval listener. May be null.- Throws:
java.lang.IllegalArgumentException- if either the retrievable, sector or file store are null, or the resolution is less than or equal to zero.
-
-
Method Detail
-
run
public abstract void run()
- Specified by:
runin interfacejava.lang.Runnable- Overrides:
runin classjava.lang.Thread
-
getRetrievable
public BulkRetrievable getRetrievable()
Get theBulkRetrievableinstance for which this thread acts.- Returns:
- the
BulkRetrievableinstance.
-
getResolution
public double getResolution()
Get the requested resolution.- Returns:
- the requested resolution.
-
getFileStore
public FileStore getFileStore()
Get the file store.- Returns:
- the file store associated with this downloader.
-
getProgress
public Progress getProgress()
Get aProgressinstance providing information about this task progress.- Returns:
- a
Progressinstance providing information about this task progress.
-
addRetrievalListener
public void addRetrievalListener(BulkRetrievalListener listener)
-
removeRetrievalListener
public void removeRetrievalListener(BulkRetrievalListener listener)
-
hasRetrievalListeners
protected boolean hasRetrievalListeners()
-
callRetrievalListeners
protected void callRetrievalListeners(BulkRetrievalEvent event)
-
-