public abstract class Downloader<T> extends Object
Constructor and Description |
---|
Downloader(Class<T> clazz,
String dataDescription)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addActionListener(ActionListener listener)
Adds a listener that will be notified if the data acquisition status
changes.
|
abstract T |
attemptReadData()
Performs the actual download.
|
void |
clearData()
Resets the state of this downloader, as if no download attempt
had been made.
|
JComponent |
createMonitorComponent()
Returns a little component that monitors status of this downloader.
|
T |
getData()
Immediately returns the downloaded data, or null if it has not been
downloaded, or if a download has failed.
|
boolean |
isComplete()
Indicates whether the data has been downloaded.
|
void |
removeActionListener(ActionListener listener)
Removes a previously added listener.
|
void |
setData(T value)
Sets the state of this downloader as if it had just downloaded the
given data item.
|
T |
waitForData()
Downloads the data if necessary, and returns its content.
|
public abstract T attemptReadData() throws IOException
IOException
public boolean isComplete()
getData()
will return the
result.public T getData()
public void clearData()
public void setData(T value)
value
- value that would have been downloadedpublic T waitForData()
public JComponent createMonitorComponent()
public void addActionListener(ActionListener listener)
listener
- listenerpublic void removeActionListener(ActionListener listener)
listener
- listenerCopyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.