|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.util.gui.Downloader<T>
public abstract class Downloader<T>
Manages downloading of data that only needs to be got once.
Constructor Summary | |
---|---|
Downloader(Class<T> clazz,
String dataDescription)
Constructor. |
Method Summary | |
---|---|
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 the 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. |
T |
waitForData()
Downloads the data if necessary, and returns its content. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Downloader(Class<T> clazz, String dataDescription)
clazz
- type of data downloadeddataDescription
- short description of downloaded data,
may be used in logging messagesMethod Detail |
---|
public abstract T attemptReadData() throws IOException
IOException
public boolean isComplete()
getData()
will return the
result.
public T getData()
public void clearData()
public T waitForData()
public JComponent createMonitorComponent()
public void addActionListener(ActionListener listener)
listener
- listenerpublic void removeActionListener(ActionListener listener)
listener
- listener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |