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.Thread
Retrieves data for aBulkRetrievable
.
-
-
Field Summary
Fields Modifier and Type Field Description protected FileStore
fileStore
protected Progress
progress
protected double
resolution
protected BulkRetrievable
retrievable
protected int
RETRIEVAL_SERVICE_POLL_DELAY
protected javax.swing.event.EventListenerList
retrievalListeners
protected Sector
sector
-
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 void
addRetrievalListener(BulkRetrievalListener listener)
protected void
callRetrievalListeners(BulkRetrievalEvent event)
FileStore
getFileStore()
Get the file store.Progress
getProgress()
Get aProgress
instance providing information about this task progress.double
getResolution()
Get the requested resolution.BulkRetrievable
getRetrievable()
Get theBulkRetrievable
instance for which this thread acts.Sector
getSector()
Get the requestedSector
.protected boolean
hasRetrievalListeners()
void
removeRetrievalListener(BulkRetrievalListener listener)
abstract void
run()
-
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 specifiedFileStore
a retrievable's data for a givenSector
and 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:
run
in interfacejava.lang.Runnable
- Overrides:
run
in classjava.lang.Thread
-
getRetrievable
public BulkRetrievable getRetrievable()
Get theBulkRetrievable
instance for which this thread acts.- Returns:
- the
BulkRetrievable
instance.
-
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 aProgress
instance providing information about this task progress.- Returns:
- a
Progress
instance 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)
-
-