|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.logging.progress.AbstractProgress de.lmu.ifi.dbs.elki.logging.progress.FiniteProgress
public class FiniteProgress
A progress object for a given overall number of items to process. The number of already processed items at a point in time can be updated. The main feature of this class is to provide a String representation of the progress suitable as a message for printing to the command line interface.
Field Summary | |
---|---|
private int |
total
The overall number of items to process. |
private int |
totalLength
Holds the length of a String describing the total number. |
Constructor Summary | |
---|---|
FiniteProgress(String task,
int total)
Deprecated. |
|
FiniteProgress(String task,
int total,
Logging logger)
Constructor with auto-reporting to logging. |
Method Summary | |
---|---|
StringBuffer |
appendToBuffer(StringBuffer 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. |
void |
setProcessed(int processed)
Sets the number of items already processed at a time being. |
Methods inherited from class de.lmu.ifi.dbs.elki.logging.progress.AbstractProgress |
---|
getProcessed, getTask, incrementProcessed, incrementProcessed, setProcessed, testLoggingRate, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private final int total
private final int totalLength
Constructor Detail |
---|
@Deprecated public FiniteProgress(String task, int total)
task
- the name of the tasktotal
- the overall number of items to processpublic FiniteProgress(String task, int total, Logging logger)
task
- the name of the tasktotal
- the overall number of items to processlogger
- the logger to report toMethod Detail |
---|
public void setProcessed(int processed) throws IllegalArgumentException
setProcessed
in class AbstractProgress
processed
- the number of items already processed at a time being
IllegalArgumentException
- if the given number is negative or exceeds
the overall number of items to processpublic StringBuffer appendToBuffer(StringBuffer buf)
appendToBuffer
in interface Progress
appendToBuffer
in class AbstractProgress
buf
- Buffer to serialize to
public boolean isComplete()
public int getTotal()
public void ensureCompleted(Logging logger)
logger
- Logger to report to.
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |