- 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 StringbuildMessage(double progress, String comment, boolean isRoot, boolean isFinished, NumberFormat numberFormat)Build the logging message from the given data.LoggergetLogger()Replies the logger used by this monitor.ProgressiongetModel()Replies the task progression model.voidonProgressionValueChanged(ProgressionEvent event)Invoked when the value, the minimum or the maximum has changed.voidsetLogger(Logger logger)Change the logger used by this monitor.voidsetModel(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 loggerwill be used.- Parameters:
logger- - the new logger.
-
onProgressionValueChanged
public void onProgressionValueChanged(ProgressionEvent event)
Description copied from interface:ProgressionListenerInvoked when the value, the minimum or the maximum has changed.- Specified by:
onProgressionValueChangedin 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.
-
-