Last update: 2011-06-23

org.proteios.core
Class SimpleProgressReporter

java.lang.Object
  extended by org.proteios.core.SimpleProgressReporter
All Implemented Interfaces:
ProgressReporter
Direct Known Subclasses:
SimpleAbsoluteProgressReporter

public class SimpleProgressReporter
extends Object
implements ProgressReporter

This is a simple implementation of the 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.

Author:
nicklas

Constructor Summary
SimpleProgressReporter(ProgressReporter progress)
          Create a new simple progress reporter.
 
Method Summary
 void append(String message)
          Append a message to the previous one.
 void display(int percent, String message)
          Display a progress message.
 String getMessage()
          Get the last progress message this progress reporter should display.
 int getPercent()
          Get the last percentage completed of the task.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleProgressReporter

public SimpleProgressReporter(ProgressReporter progress)
Create a new simple progress reporter.

Parameters:
progress - ProgressReporter An optional progress which is also notified about the progress.
Method Detail

display

public void display(int percent,
                    String message)
Description copied from interface: ProgressReporter
Display a progress message.

Specified by:
display in interface ProgressReporter
Parameters:
percent - How many percent of the task that is completed
message - A message, or null

append

public void append(String message)
Description copied from interface: ProgressReporter
Append a message to the previous one.

Specified by:
append in interface ProgressReporter
Parameters:
message - The message

getMessage

public String getMessage()
Get the last progress message this progress reporter should display.

Returns:
String The last progress message this progress reporter should display.

getPercent

public int getPercent()
Get the last percentage completed of the task.

Returns:
int The last percentage completed of the task.

Last update: 2011-06-23