|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectifs.util.Progress
public class Progress
Progress bar.
Single instance class for recording the current state. It also allows recursive storing/restoring of the progress.
Use:
Progress.getInstance().setStatus("Loading input data");
Progress.getInstance().setPhase("Creating variables ...", nrVariables);
for (int i=0;i
//load variable here
Progress.getInstance().incProgress();
}
Progress.getInstance().setPhase("Creating constraints ...", nrConstraints);
for (int i=0;i
//load constraint here
Progress.getInstance().incProgress();
}
Progress.getInstance().setStatus("Solving problem");
...
| Method Summary | |
|---|---|
void |
addProgressListener(ProgressListener listener)
Adds progress listener |
static Progress |
getInstance()
Progress instance |
String |
getPhase()
Current phase |
long |
getProgress()
Current progress |
long |
getProgressMax()
Maximum of current progress |
String |
getStatus()
Current status |
void |
incProgress()
Increment current progress |
void |
removeProgressListener(ProgressListener listener)
Remove progress listener |
void |
restore()
Resore the progress from the heap memory |
void |
save()
Save current progress to the heap memory |
void |
setPhase(String phase)
Sets current phase. |
void |
setPhase(String phase,
long progressMax)
Sets current phase |
void |
setProgress(long progress)
Update progress bar. |
void |
setStatus(String status)
Sets current status |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Progress getInstance()
public String getStatus()
public void setStatus(String status)
public String getPhase()
public void setPhase(String phase,
long progressMax)
phase - phase nameprogressMax - maximum of progress barpublic void setPhase(String phase)
phase - phase namepublic void setProgress(long progress)
progress - progress between 0 and progressMaxpublic long getProgress()
public long getProgressMax()
public void incProgress()
public void addProgressListener(ProgressListener listener)
public void removeProgressListener(ProgressListener listener)
public void save()
public void restore()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||