public class FiniteProgress extends AbstractProgress
Modifier and Type | Field and Description |
---|---|
private int |
total
The overall number of items to process.
|
private int |
totalLength
Holds the length of a String describing the total number.
|
Modifier | Constructor and Description |
---|---|
protected |
FiniteProgress(String task,
int total)
Constructor.
|
|
FiniteProgress(String task,
int total,
Logging logger)
Constructor with auto-reporting to logging.
|
Modifier and Type | Method and Description |
---|---|
StringBuilder |
appendToBuffer(StringBuilder buf)
Append a string representation of the progress to the given string buffer.
|
void |
ensureCompleted(Logging logger)
Ensure that the progress was completed, to make progress bars disappear
|
int |
getTotal()
Get the final value for the progress.
|
boolean |
isComplete()
Test whether the progress was completed.
|
protected void |
setProcessed(int processed)
Sets the number of items already processed at a time being.
|
getProcessed, getTask, incrementProcessed, setProcessed, testLoggingRate, toString
private final int total
private final int totalLength
protected FiniteProgress(String task, int total)
task
- the name of the tasktotal
- the overall number of items to processprotected void setProcessed(int processed) throws IllegalArgumentException
setProcessed
in class AbstractProgress
processed
- the number of items already processed at a time beingIllegalArgumentException
- if the given number is negative or exceeds
the overall number of items to processpublic StringBuilder appendToBuffer(StringBuilder buf)
appendToBuffer
in interface Progress
appendToBuffer
in class AbstractProgress
buf
- Buffer to serialize topublic boolean isComplete()
public int getTotal()
public void ensureCompleted(Logging logger)
logger
- Logger to report to.Copyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.