nl.knowledgeplaza.util
Class ProgressListener
java.lang.Object
nl.knowledgeplaza.util.ProgressListener
- Direct Known Subclasses:
- ProgressListener.ConsoleProgressListener
public abstract class ProgressListener
- extends java.lang.Object
A class to provide progress feedback.
The class does not dictate what the listened to process will provide for feedback.
It may or may not class begin, done or init. That depends on the implementation in the process that is monitored.
Progress is called always, but it is undefined how often, that -again- depends on the implementation in the process that is monitored.
An actual progress listener should extend this class.
It can override the neccesary methods and do with the information what is appropriate for the context.
For example:
- the information can be printed on System.out (see the default progressListenerConsole in this class)
- in a Swing application the information can be forwarded to a ProgressMonitor component (see the default ProgressMonitor.progressListener).
This is implemented as an abstract class and not an interface, so that future changes will not required existing code to be modified.
|
Method Summary |
void |
begin()
|
boolean |
cancel()
|
void |
done()
|
void |
init(long min,
long max)
|
abstract void |
progress(long current,
java.lang.String info)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
progressListenerConsole
public static ProgressListener progressListenerConsole
ProgressListener
public ProgressListener()
init
public void init(long min,
long max)
begin
public void begin()
progress
public abstract void progress(long current,
java.lang.String info)
done
public void done()
cancel
public boolean cancel()
Copyright © 2010 KnowledgePlaza. All Rights Reserved.