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.
|
ratems
Modifier | Constructor and Description |
---|---|
protected |
FiniteProgress(java.lang.String task,
int total)
Constructor.
|
|
FiniteProgress(java.lang.String task,
int total,
Logging logger)
Constructor with auto-reporting to logging.
|
Modifier and Type | Method and Description |
---|---|
java.lang.StringBuilder |
appendToBuffer(java.lang.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(java.lang.String task, int total)
task
- the name of the tasktotal
- the overall number of items to processpublic FiniteProgress(java.lang.String task, int total, Logging logger)
task
- the name of the tasktotal
- the overall number of items to processlogger
- the logger to report toprotected void setProcessed(int processed) throws java.lang.IllegalArgumentException
setProcessed
in class AbstractProgress
processed
- the number of items already processed at a time beingjava.lang.IllegalArgumentException
- if the given number is negative or exceeds
the overall number of items to processpublic java.lang.StringBuilder appendToBuffer(java.lang.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 © 2019 ELKI Development Team. License information.