Package uk.ac.starlink.topcat.activate
Class Downloader<T>
java.lang.Object
uk.ac.starlink.topcat.activate.Downloader<T>
Manages download of data that may be required in multiple places.
- Since:
- 24 Oct 2019
- Author:
- Mark Taylor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a listener that will be notified when the data has become available.getData()
Immediately returns the downloaded data, or null if it has not been downloaded, or if a download has failed.void
Removes a listener previously added.void
start()
Ensures that this downloader has started to downloading the data.
-
Constructor Details
-
Downloader
Constructor.- Parameters:
dataDescription
- short description of downloaded data, may be used in logging messagessupplier
- supplier of downloaded data
-
-
Method Details
-
start
public void start()Ensures that this downloader has started to downloading the data. If it has already started (and possibly finished), this has no effect. -
getData
Immediately returns the downloaded data, or null if it has not been downloaded, or if a download has failed.- Returns:
- downloaded result, or null
-
addActionListener
Adds a listener that will be notified when the data has become available.- Parameters:
l
- listener
-
removeActionListener
Removes a listener previously added.- Parameters:
l
- listener
-