Package elki.logging.progress
Class StepProgress
- java.lang.Object
-
- elki.logging.progress.AbstractProgress
-
- elki.logging.progress.FiniteProgress
-
- elki.logging.progress.StepProgress
-
- All Implemented Interfaces:
Progress
public class StepProgress extends FiniteProgress
This progress class is used for multi-step processing.- Since:
- 0.4.0
- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.String
stepTitle
Title of the current step.-
Fields inherited from class elki.logging.progress.AbstractProgress
ratems
-
-
Constructor Summary
Constructors Constructor Description StepProgress(int total)
Constructor.StepProgress(java.lang.String task, int total)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringBuilder
appendToBuffer(java.lang.StringBuilder buf)
Append a string representation of the progress to the given string buffer.void
beginStep(int step, java.lang.String stepTitle, Logging logger)
Do a new step and log itprotected java.lang.String
getStepTitle()
void
setCompleted(Logging logger)
Mark the progress as completed and log it.-
Methods inherited from class elki.logging.progress.FiniteProgress
ensureCompleted, getTotal, isComplete, setProcessed
-
Methods inherited from class elki.logging.progress.AbstractProgress
getProcessed, getTask, incrementProcessed, setProcessed, testLoggingRate, toString
-
-
-
-
Constructor Detail
-
StepProgress
public StepProgress(int total)
Constructor. This constructor does not use a logger; initial logging will happen on the first beginStep call.- Parameters:
total
- Total number of steps.
-
StepProgress
public StepProgress(java.lang.String task, int total)
Constructor.This constructor does not use a logger; initial logging will happen on the first beginStep call.
- Parameters:
task
- Task titletotal
- Total number of steps.
-
-
Method Detail
-
appendToBuffer
public java.lang.StringBuilder appendToBuffer(java.lang.StringBuilder buf)
Description copied from class:FiniteProgress
Append a string representation of the progress to the given string buffer.- Specified by:
appendToBuffer
in interfaceProgress
- Overrides:
appendToBuffer
in classFiniteProgress
- Parameters:
buf
- Buffer to serialize to- Returns:
- Buffer the data was serialized to.
-
beginStep
public void beginStep(int step, java.lang.String stepTitle, Logging logger)
Do a new step and log it- Parameters:
step
- Step numberstepTitle
- Step titlelogger
- Logger to report to.
-
setCompleted
public void setCompleted(Logging logger)
Mark the progress as completed and log it.- Parameters:
logger
- Logger to report to.
-
getStepTitle
protected java.lang.String getStepTitle()
- Returns:
- the stepTitle
-
-