Class PlaceNameLayerBulkDownloader

  • All Implemented Interfaces:
    java.lang.Runnable

    public class PlaceNameLayerBulkDownloader
    extends BulkRetrievalThread
    Downloads placenames not currently available in the WorldWind file cache or a specified FileStore. The class derives from Thread and is meant to operate in its own thread.

    The sector and resolution associated with the downloader are specified during construction and are final.

    • Field Detail

      • MAX_TILE_COUNT_PER_REGION

        protected int MAX_TILE_COUNT_PER_REGION
      • 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:
        run in interface java.lang.Runnable
        Specified by:
        run in class BulkRetrievalThread
      • submitMissingTilesRequests

        protected void submitMissingTilesRequests()
                                           throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • 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