|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectus.zuercher.gpx2map.util.PrintStreamProgressMeter
public class PrintStreamProgressMeter
PrintStreamProgressMeter implements ProgressMeter
to write progress
information to a given PrintStream
. PrintStreamProgressMeter prints
a single period for each percent of completion until it reaches a percentage
that is an even multiple of 10%, at which point it outputs the percentage.
At 50%, it starts a new line.
Field Summary | |
---|---|
private static String |
BIG_INDENT
Double indent, used when taskName is not null . |
private int |
count
Task completion point. |
private boolean |
firstUpdate
True until the completion of the first progress update, even if that update does not cause any output of percentage markers. |
private static String |
INDENT
Basic indent, used when taskName is null . |
private int |
lastPercent
Percentage completed as of last update. |
private PrintStream |
out
The output PrintStream . |
private String |
taskName
The current task name. |
Constructor Summary | |
---|---|
PrintStreamProgressMeter(String name,
PrintStream out)
Constructs a new PrintStreamProgressMeter with the given name and using the given PrintStream for output. |
Method Summary | |
---|---|
void |
reset()
Resets the progress meter for a new task name. |
void |
setCount(int count)
Sets the number of work items for this progress meter. |
void |
setTaskName(String taskName)
Configures a task name. |
void |
updateProgress(int count)
Updates the progress meter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final String INDENT
taskName
is null
.
private static final String BIG_INDENT
taskName
is not null
.
private final PrintStream out
PrintStream
.
private String taskName
private boolean firstUpdate
private int count
private int lastPercent
Constructor Detail |
---|
public PrintStreamProgressMeter(String name, PrintStream out)
PrintStream
for output.
name
- overall name -- not a task nameout
- the output PrintStreamMethod Detail |
---|
public void setTaskName(String taskName)
setTaskName
in interface ProgressMeter
taskName
- the name of the current task within this progress meter.
IllegalStateException
- if the count
has
already been set.ProgressMeter.setTaskName(String)
public void setCount(int count)
setCount
in interface ProgressMeter
count
- the number of work itemsProgressMeter.setCount(int)
public void reset()
reset
in interface ProgressMeter
ProgressMeter.reset()
public void updateProgress(int count)
updateProgress
in interface ProgressMeter
count
- the number of work items completedProgressMeter.updateProgress(int)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |