Package net.sf.basedb.core
Class SimpleProgressReporter
java.lang.Object
net.sf.basedb.core.SimpleProgressReporter
- All Implemented Interfaces:
ProgressReporter
- Direct Known Subclasses:
SimpleAbsoluteProgressReporter
,SimpleSignalProgressReporter
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.- Version:
- 2.0
- Author:
- nicklas
- Last modified
- $Date: 2015-03-24 11:27:59 +0100 (ti, 24 mar 2015) $
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSimpleProgressReporter
(ProgressReporter progress) Create a new simple progress reporter. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Append a message to the previous one.void
Display a progress message.getError()
Get error that happened while processing some action that was reported via this progress reporter.Get the last progress message this progress reporter should display.int
Get the last percentage completed of the task.void
Set an error that happened while processing some action that was reported via this progress reporter.
-
Field Details
-
progress
-
message
-
percent
private int percent -
error
-
-
Constructor Details
-
SimpleProgressReporter
Create a new simple progress reporter.- Parameters:
progress
- An optional progress which is also notified about the progress
-
-
Method Details
-
display
Description copied from interface:ProgressReporter
Display a progress message.- Specified by:
display
in interfaceProgressReporter
- Parameters:
percent
- How many percent of the task that is completed or -1 if not knownmessage
- A message, or null
-
append
Description copied from interface:ProgressReporter
Append a message to the previous one.- Specified by:
append
in interfaceProgressReporter
- Parameters:
message
- The message
-
getMessage
Get the last progress message this progress reporter should display. -
getPercent
public int getPercent()Get the last percentage completed of the task. -
setError
Set an error that happened while processing some action that was reported via this progress reporter.- Since:
- 3.5
-
getError
Get error that happened while processing some action that was reported via this progress reporter.- Since:
- 3.5
-