nl.knowledgeplaza.util
Class ProgressListener

java.lang.Object
  extended by nl.knowledgeplaza.util.ProgressListener
Direct Known Subclasses:
ProgressListener.ConsoleProgressListener

public abstract class ProgressListener
extends 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.


Nested Class Summary
static class ProgressListener.ConsoleProgressListener
          a default ProgressListener that simply writes to the console
 
Field Summary
static ProgressListener progressListenerConsole
           
 
Constructor Summary
ProgressListener()
           
 
Method Summary
 void begin()
           
 boolean cancel()
           
 void done()
           
 void init(long min, long max)
           
 void progress(long current)
           
abstract  void progress(long current, String info)
           
 void reset(long min, long max)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

progressListenerConsole

public static ProgressListener progressListenerConsole
Constructor Detail

ProgressListener

public ProgressListener()
Method Detail

init

public void init(long min,
                 long max)

reset

public void reset(long min,
                  long max)

begin

public void begin()

progress

public abstract void progress(long current,
                              String info)

progress

public void progress(long current)

done

public void done()

cancel

public boolean cancel()


Copyright © 2012 KnowledgePlaza. All Rights Reserved.