public abstract class ProgressTracker
extends Object
implements Cloneable
Modifier and Type | Class and Description |
---|---|
private class |
ProgressTracker.IntHolder |
private class |
ProgressTracker.LongHolder |
private class |
ProgressTracker.StringHolder |
Modifier and Type | Field and Description |
---|---|
private float |
hiPct |
private float |
loPct |
private int |
minInterval |
private ProgressTracker.StringHolder |
prevDescrip |
private ProgressTracker.IntHolder |
prevPctDone |
private ProgressTracker.LongHolder |
prevTime |
Constructor and Description |
---|
ProgressTracker()
Initialize a 0..100% tracker
|
ProgressTracker(float loPct,
float hiPct)
Initialize a tracker for some other percentage range
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Clone this tracker
|
void |
progress(long workDone,
long totalWork,
String descrip)
To be called periodically by code that does work.
|
void |
progress(long workDone,
long totalWork,
String descrip,
boolean force)
To be called periodically by code that does work.
|
abstract void |
report(int pctDone,
String descrip)
Supply this method to actually print out the progress
|
void |
setMinInterval(int millisecs)
Override the default update interval of 30 seconds
|
ProgressTracker[] |
split(long[] works)
Split this tracker into an arbitrary number of sub-trackers, based on
how much work each sub-tracker needs to do.
|
ProgressTracker[] |
split(long work1,
long work2)
Split this tracker into two sub-trackers, based on how much work
each sub-tracker needs to do.
|
ProgressTracker[] |
split(long work1,
long work2,
long work3)
Split this tracker into three sub-trackers, based on how much work
each sub-tracker needs to do.
|
ProgressTracker[] |
split(long work1,
long work2,
long work3,
long work4)
Split this tracker into four sub-trackers, based on how much work
each sub-tracker needs to do.
|
private float loPct
private float hiPct
private int minInterval
private ProgressTracker.IntHolder prevPctDone
private ProgressTracker.LongHolder prevTime
private ProgressTracker.StringHolder prevDescrip
public ProgressTracker()
public ProgressTracker(float loPct, float hiPct)
public void setMinInterval(int millisecs)
millisecs
- how many milliseconds between updates (minimum)public ProgressTracker[] split(long work1, long work2)
public ProgressTracker[] split(long work1, long work2, long work3)
public ProgressTracker[] split(long work1, long work2, long work3, long work4)
public ProgressTracker[] split(long[] works)
public Object clone()
clone
in class Object
public void progress(long workDone, long totalWork, String descrip)
public void progress(long workDone, long totalWork, String descrip, boolean force)
public abstract void report(int pctDone, String descrip)