de.jstacs.utils
Class NullProgressUpdater

java.lang.Object
  extended by de.jstacs.utils.NullProgressUpdater
All Implemented Interfaces:
ProgressUpdater

public class NullProgressUpdater
extends Object
implements ProgressUpdater

This class implements a ProgressUpdater doing nothing but forces a crossvalidation that is used with an instance of this class to continue to its end.
May be used, if no progress update is wished during a crossvalidation.

Author:
Andre Gohr

Method Summary
 void close()
          Closes the supervision.
static NullProgressUpdater getImmutableInstance()
          Returns a reference to the same NullProgressUpdater that is immutable.
 boolean isCancelled()
          Specifies if the process is cancelled by the user.
 void setMax(int max)
          Sets the maximal value that will be set by ProgressUpdater.setValue(int), so a value of max indicates the end of the supervised method call.
 void setOffset()
          After setOffset() is called the current value will be added to every value set by setValue(int).
 void setValue(int value)
          Sets the current value the supervised process has reached.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getImmutableInstance

public static NullProgressUpdater getImmutableInstance()
Returns a reference to the same NullProgressUpdater that is immutable.

Returns:
always a reference to the same NullProgressUpdater that is immutable since all methods except isCancelled() are not implemented. The method isCancelled() always returns false to force the crossvalidation to continue

setMax

public void setMax(int max)
Description copied from interface: ProgressUpdater
Sets the maximal value that will be set by ProgressUpdater.setValue(int), so a value of max indicates the end of the supervised method call.

Specified by:
setMax in interface ProgressUpdater
Parameters:
max - the maximal value

setValue

public void setValue(int value)
Description copied from interface: ProgressUpdater
Sets the current value the supervised process has reached.

Specified by:
setValue in interface ProgressUpdater
Parameters:
value - the current value

close

public void close()
Closes the supervision.


setOffset

public void setOffset()
After setOffset() is called the current value will be added to every value set by setValue(int).


isCancelled

public boolean isCancelled()
Description copied from interface: ProgressUpdater
Specifies if the process is cancelled by the user.

Specified by:
isCancelled in interface ProgressUpdater
Returns:
true if process was cancelled, false otherwise