|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjcolibri.util.ProgressController
public class ProgressController
This class allows methods to indicate their progress in a long task.
This is a modification of the Observer pattern where the notifier of the tasks keeps a list of observers and notifies them its progress.
Here we centralize the managing of the observers in this class simplifing the code of the notifiers.
If a method wants to notify its progress it only has to call to:
ProgressController
Field Summary | |
---|---|
static int |
UNKNOWN_STEPS
Defines unknown number of steps for a progress |
Constructor Summary | |
---|---|
ProgressController()
|
Method Summary | |
---|---|
static void |
clear()
Removes all listeners |
static void |
deregister(ProgressListener pl)
Deregisters a listener to recieve the progress of all classes. |
static void |
deregister(ProgressListener pl,
java.lang.Class c)
Deregisters a listener to recieve the progress of a concrete class. |
static void |
finish(java.lang.Class c)
Finishes the progress of a task. |
static void |
init(java.lang.Class c,
java.lang.String info,
int numberOfSteps)
Notifies to all the listeners of a class that the progress is begining. |
static void |
register(ProgressListener pl)
Registers a listener to recieve the progress of all classes. |
static void |
register(ProgressListener pl,
java.lang.Class c)
Registers a listener to recieve the progress of a concrete class. |
static void |
step(java.lang.Class c)
Notifies a new step in the task for a concrete class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int UNKNOWN_STEPS
Constructor Detail |
---|
public ProgressController()
Method Detail |
---|
public static void clear()
public static void register(ProgressListener pl, java.lang.Class c)
public static void register(ProgressListener pl)
public static void deregister(ProgressListener pl, java.lang.Class c)
public static void deregister(ProgressListener pl)
public static void init(java.lang.Class c, java.lang.String info, int numberOfSteps)
c
- Class that notifies the progress.info
- Some info about the progress.numberOfSteps
- Number of steps of the task. If unknown it must be -1.public static void step(java.lang.Class c)
public static void finish(java.lang.Class c)
|
GAIA - Group for Artificial Intelligence Applications http://gaia.fdi.ucm.es |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |