public abstract class AbstractProgress extends java.lang.Object implements Progress
Modifier and Type | Field and Description |
---|---|
private long |
lastLogged
For logging rate control.
|
private int |
lastValue
Last logged value.
|
private java.util.concurrent.atomic.AtomicInteger |
processed
The number of items already processed at a time being.
|
protected double |
ratems
Last rate.
|
private java.lang.String |
task
The task name.
|
Constructor and Description |
---|
AbstractProgress(java.lang.String task)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract java.lang.StringBuilder |
appendToBuffer(java.lang.StringBuilder buf)
Serialize a description into a String buffer.
|
int |
getProcessed()
Get the number of items already processed at a time being.
|
java.lang.String |
getTask()
Provides the name of the task.
|
void |
incrementProcessed(Logging logger)
Increment the processed counter.
|
protected void |
setProcessed(int processed)
Sets the number of items already processed at a time being.
|
void |
setProcessed(int processed,
Logging logger)
Sets the number of items already processed at a time being.
|
protected boolean |
testLoggingRate(int processed)
Logging rate control.
|
java.lang.String |
toString()
Returns a String representation of the progress suitable as a message for
printing to the command line interface.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isComplete
private java.util.concurrent.atomic.AtomicInteger processed
private java.lang.String task
private long lastLogged
private int lastValue
protected double ratems
public AbstractProgress(java.lang.String task)
task
- Task name.public java.lang.String getTask()
protected void setProcessed(int processed) throws java.lang.IllegalArgumentException
processed
- the number of items already processed at a time beingjava.lang.IllegalArgumentException
- if an invalid value was passed.public void setProcessed(int processed, Logging logger) throws java.lang.IllegalArgumentException
processed
- the number of items already processed at a time beinglogger
- Logger to report tojava.lang.IllegalArgumentException
- if an invalid value was passed.public int getProcessed()
public abstract java.lang.StringBuilder appendToBuffer(java.lang.StringBuilder buf)
appendToBuffer
in interface Progress
buf
- Buffer to serialize topublic java.lang.String toString()
public void incrementProcessed(Logging logger)
logger
- Logger to report to.protected boolean testLoggingRate(int processed)
processed
- CounterCopyright © 2019 ELKI Development Team. License information.