- java.lang.Object
-
- org.arakhne.afc.progress.ProgressionConsoleMonitor
-
- All Implemented Interfaces:
EventListener
,ProgressionListener
public class ProgressionConsoleMonitor extends Object implements ProgressionListener
An object that permits to indicates the progression of a task. This monitor display on the console the progression of the task.- Version:
- 17.0 2020-01-04 14:41:38
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- util
-
-
Constructor Summary
Constructors Constructor Description ProgressionConsoleMonitor()
Construct a monitor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
buildMessage(double progress, String comment, boolean isRoot, boolean isFinished, NumberFormat numberFormat)
Build the logging message from the given data.Logger
getLogger()
Replies the logger used by this monitor.Progression
getModel()
Replies the task progression model.void
onProgressionValueChanged(ProgressionEvent event)
Invoked when the value, the minimum or the maximum has changed.void
setLogger(Logger logger)
Change the logger used by this monitor.void
setModel(Progression model)
Change the task progression model.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.arakhne.afc.progress.ProgressionListener
onProgressionStateChanged
-
-
-
-
Method Detail
-
getModel
public Progression getModel()
Replies the task progression model.- Returns:
- the task progression model.
-
setModel
public void setModel(Progression model)
Change the task progression model.- Parameters:
model
- - the task progression model.
-
getLogger
public Logger getLogger()
Replies the logger used by this monitor.- Returns:
- the logger, never
null
-
setLogger
public void setLogger(Logger logger)
Change the logger used by this monitor. If the given logger isnull
, then thedefault anonymous logger
will be used.- Parameters:
logger
- - the new logger.
-
onProgressionValueChanged
public void onProgressionValueChanged(ProgressionEvent event)
Description copied from interface:ProgressionListener
Invoked when the value, the minimum or the maximum has changed.- Specified by:
onProgressionValueChanged
in interfaceProgressionListener
- Parameters:
event
- is the description of the event.
-
buildMessage
protected String buildMessage(double progress, String comment, boolean isRoot, boolean isFinished, NumberFormat numberFormat)
Build the logging message from the given data. This function is defined for enabling overriding in sub classes.- Parameters:
progress
- - progression indicator between 0 and 1.comment
- - associated comment.isRoot
- - indicates if the progression model is a root model.isFinished
- - indicates if the task is finished.numberFormat
- - instance of the number formatter.- Returns:
- the message.
-
-