Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.utilities.progress
Class AbstractProgress

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.utilities.progress.AbstractProgress
All Implemented Interfaces:
Progress
Direct Known Subclasses:
FiniteProgress, IndefiniteProgress

public abstract class AbstractProgress
extends Object
implements Progress

Abstract base class for FiniteProgress objects.

Author:
Erich Schubert

Field Summary
private  int processed
          The number of items already processed at a time being.
private  String task
          The task name.
 
Constructor Summary
AbstractProgress(String task)
          Default constructor.
 
Method Summary
abstract  StringBuffer appendToBuffer(StringBuffer buf)
          Serialize a description into a String buffer.
 int getProcessed()
          Get the number of items already processed at a time being.
 String getTask()
          Provides the name of the task.
 void setProcessed(int processed)
          Sets the number of items already processed at a time being.
 String toString()
          Returns a String representation of the progress suitable as a message for printing to the command line interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.progress.Progress
complete
 

Field Detail

processed

private int processed
The number of items already processed at a time being.


task

private String task
The task name.

Constructor Detail

AbstractProgress

public AbstractProgress(String task)
Default constructor.

Parameters:
task - Task name.
Method Detail

getTask

public String getTask()
Provides the name of the task.

Returns:
the name of the task

setProcessed

public void setProcessed(int processed)
                  throws IllegalArgumentException
Sets the number of items already processed at a time being.

Parameters:
processed - the number of items already processed at a time being
Throws:
IllegalArgumentException - if an invalid value was passed.

getProcessed

public int getProcessed()
Get the number of items already processed at a time being.

Returns:
number of processed items

appendToBuffer

public abstract StringBuffer appendToBuffer(StringBuffer buf)
Serialize a description into a String buffer.

Specified by:
appendToBuffer in interface Progress
Parameters:
buf - Buffer to serialize to
Returns:
Buffer the data was serialized to.

toString

public String toString()
Returns a String representation of the progress suitable as a message for printing to the command line interface.

Specified by:
toString in interface Progress
Overrides:
toString in class Object
See Also:
Object.toString()

Release 0.2.1 (2009-07-13_1605)