public class SimpleProgressReporter extends java.lang.Object implements ProgressReporter
ProgressReporter
interface,
which simply remembers that last values. An application may use the getMessage()
and getPercent()
method to get information about the
progress. This implementation also supports forwarding the progress information
to another progress reporter.Modifier and Type | Field and Description |
---|---|
private java.lang.String |
message |
private int |
percent |
private ProgressReporter |
progress |
Constructor and Description |
---|
SimpleProgressReporter(ProgressReporter progress)
Create a new simple progress reporter.
|
Modifier and Type | Method and Description |
---|---|
void |
append(java.lang.String message)
Append a message to the previous one.
|
void |
display(int percent,
java.lang.String message)
Display a progress message.
|
java.lang.String |
getMessage()
Get the last progress message this progress reporter should display.
|
int |
getPercent()
Get the last percentage completed of the task.
|
private final ProgressReporter progress
private java.lang.String message
private int percent
public SimpleProgressReporter(ProgressReporter progress)
progress
- An optional progress which is also notified about
the progresspublic void display(int percent, java.lang.String message)
ProgressReporter
display
in interface ProgressReporter
percent
- How many percent of the task that is completed
or -1 if not knownmessage
- A message, or nullpublic void append(java.lang.String message)
ProgressReporter
append
in interface ProgressReporter
message
- The messagepublic java.lang.String getMessage()
public int getPercent()