gov.nih.nlm.util
Class ProgressEvent

java.lang.Object
  extended bygov.nih.nlm.util.ProgressEvent

public class ProgressEvent
extends Object

Generically represents an update to progress information.


Constructor Summary
ProgressEvent(Object source, int pct, long progress, String note)
          Instantiates a ProgressEvent from the specified information.
 
Method Summary
 String getNote()
          Returns the note.
 int getPercent()
          Returns the percentage completed.
 long getProgress()
          Returns the progress.
 int getScaledPercent(int low, int high)
          Returns the scaled percentage.
 Object getSource()
          Returns the source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProgressEvent

public ProgressEvent(Object source,
                     int pct,
                     long progress,
                     String note)
Instantiates a ProgressEvent from the specified information.

Parameters:
source - event source
pct - percent finished
progress - total progress value
note - progress note
Method Detail

getPercent

public int getPercent()
Returns the percentage completed.

Returns:
the percentage completed

getScaledPercent

public int getScaledPercent(int low,
                            int high)
Returns the scaled percentage. It maps a 0 to 100 range to the specified range. E.g. If getPercent() returns 50, getScaledPercent(50,100) eturns 75.

Parameters:
low - the low end of the scale
high - the high end of the scale
Returns:
the scaled percentage completed

getProgress

public long getProgress()
Returns the progress.

Returns:
the progress

getNote

public String getNote()
Returns the note.

Returns:
the note

getSource

public Object getSource()
Returns the source.

Returns:
the source


Copyright ©2005