Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## ifs.util
Class Progress

    java.lang.Object
      ifs.util.Progress

    public class Progress

extends Object

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");
...
`

Version:
  1.0
Author:
  Tomáš Müller

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

### getInstance

    public static Progress getInstance()

  Progress instance

### getStatus

    public String getStatus()

  Current status

### setStatus

    public void setStatus(String status)

  Sets current status

### getPhase

    public String getPhase()

  Current phase

### setPhase

    public void setPhase(String phase,
                         long progressMax)

  Sets current phase

  Parameters:
    `phase` - phase name
    `progressMax` - maximum of progress bar

### setPhase

    public void setPhase(String phase)

  Sets current phase. Maximum of progress bar is set to 100.

  Parameters:
    `phase` - phase name

### setProgress

    public void setProgress(long progress)

  Update progress bar.

  Parameters:
    `progress` - progress between 0 and progressMax

### getProgress

    public long getProgress()

  Current progress

### getProgressMax

    public long getProgressMax()

  Maximum of current progress

### incProgress

    public void incProgress()

  Increment current progress

### addProgressListener

    public void addProgressListener(ProgressListener listener)

  Adds progress listener

### removeProgressListener

    public void removeProgressListener(ProgressListener listener)

  Remove progress listener

### save

    public void save()

  Save current progress to the heap memory

### restore

    public void restore()

  Resore the progress from the heap memory

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005 Tomáš Müller