cz.cuni.jagrlib
Class ProgressCounter

java.lang.Object
  extended by cz.cuni.jagrlib.ProgressCounter
All Implemented Interfaces:
ProgressListener

public class ProgressCounter
extends java.lang.Object
implements ProgressListener

Object able to process progress messages and compute a little more complex results.

See Also:
ProgressCounter.java

Field Summary
protected  double progressAct
          Actual progress.
protected  double progressAdd
          Progress origin.
protected  double progressMul
          Progress multiplier.
protected  double progressStart
          Starting progress.
protected  long timeAct
          Actual time in milliseconds.
protected  long timeStart
          Starting time in milliseconds.
 
Constructor Summary
ProgressCounter()
           
 
Method Summary
 java.lang.String message()
          Assembles more complex "Finished.." message.
 void progress(long state, long total)
          Sets progress state (0 <= state <= total).
 java.lang.String remainingString()
          Estimates remaining time and returns its HH:MM:SS representation.
 double remainingTime()
          Estimates remaining time in seconds.
 void repaint()
          Repaint progress indicator (if applicable).
 void setInterval(double mul, double add)
          Sets actual progress-interval (domain of both parameters is < 0.0, 1.0 >).
 double totalTime()
          Total time in seconds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timeStart

protected long timeStart
Starting time in milliseconds.


timeAct

protected long timeAct
Actual time in milliseconds.


progressStart

protected double progressStart
Starting progress.


progressAct

protected double progressAct
Actual progress.


progressMul

protected double progressMul
Progress multiplier.


progressAdd

protected double progressAdd
Progress origin.

Constructor Detail

ProgressCounter

public ProgressCounter()
Method Detail

progress

public void progress(long state,
                     long total)
Sets progress state (0 &lt;= state &lt;= total).

Specified by:
progress in interface ProgressListener

repaint

public void repaint()
Repaint progress indicator (if applicable).

Specified by:
repaint in interface ProgressListener

setInterval

public void setInterval(double mul,
                        double add)
Sets actual progress-interval (domain of both parameters is < 0.0, 1.0 >).


totalTime

public double totalTime()
Total time in seconds.


remainingTime

public double remainingTime()
Estimates remaining time in seconds.


remainingString

public java.lang.String remainingString()
Estimates remaining time and returns its HH:MM:SS representation.


message

public java.lang.String message()
Assembles more complex "Finished.." message.