Package net.sf.basedb.core
Class SimpleAbsoluteProgressReporter
- java.lang.Object
-
- net.sf.basedb.core.SimpleProgressReporter
-
- net.sf.basedb.core.SimpleAbsoluteProgressReporter
-
- All Implemented Interfaces:
AbsoluteProgressReporter
,ProgressReporter
public class SimpleAbsoluteProgressReporter extends SimpleProgressReporter implements AbsoluteProgressReporter
This is a simple implementation of theAbsoluteProgressReporter
interface, which simply remembers that last values.- Version:
- 2.0
- Author:
- nicklas
- See Also:
SimpleProgressReporter
- Last modified
- $Date: 2012-09-14 09:28:35 +0200 (fr, 14 sep 2012) $
-
-
Field Summary
Fields Modifier and Type Field Description private long
baseCompleted
private long
completed
private String
message
private long
total
-
Constructor Summary
Constructors Constructor Description SimpleAbsoluteProgressReporter(ProgressReporter progress, long total)
Create a new absolute progress reporter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
displayAbsolute(long completed, String message)
Display a progress message.long
getCompleted()
Get completed number of ticks of the task.long
getTotal()
Get the end point of the task.void
setAbsolute(long completed, String message)
Set a basic progress level.-
Methods inherited from class net.sf.basedb.core.SimpleProgressReporter
append, display, getError, getMessage, getPercent, setError
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.basedb.core.ProgressReporter
append, display
-
-
-
-
Field Detail
-
total
private final long total
-
completed
private long completed
-
baseCompleted
private long baseCompleted
-
message
private String message
-
-
Constructor Detail
-
SimpleAbsoluteProgressReporter
public SimpleAbsoluteProgressReporter(ProgressReporter progress, long total)
Create a new absolute progress reporter. If the total is set to -1 (unknown size), all percentages are forwarded to the parent as -1.- Parameters:
progress
- An optional progress which is also notified about the progresstotal
- The end point of task, or -1 if not known
-
-
Method Detail
-
displayAbsolute
public void displayAbsolute(long completed, String message)
Description copied from interface:AbsoluteProgressReporter
Display a progress message.- Specified by:
displayAbsolute
in interfaceAbsoluteProgressReporter
- Parameters:
completed
- The progress of the taskmessage
- A message, or null
-
getTotal
public long getTotal()
Get the end point of the task.
-
getCompleted
public long getCompleted()
Get completed number of ticks of the task.
-
setAbsolute
public void setAbsolute(long completed, String message)
Set a basic progress level. Subsequent calls todisplayAbsolute(long, String)
are based on the completed value and message set here.- Parameters:
completed
- The basic completed progressmessage
- A default message- Since:
- 2.16
-
-