iterator
Class AbstractIterator

java.lang.Object
  extended by iterator.AbstractIterator
All Implemented Interfaces:
Iterable
Direct Known Subclasses:
AbstractOptimizer, CommandLineRunner

public abstract class AbstractIterator
extends java.lang.Object
implements Iterable

Abstract class to implement some methods of the Iterable interface. Provides a protected printDiagnostics() method that can be extended to output diagnostic messages at each iteration when the verbose flag is set.

Author:
dgorur

Field Summary
protected  java.lang.String diagnosticString
           
protected  int iter
           
 
Constructor Summary
AbstractIterator()
           
 
Method Summary
 boolean isVerbose()
          Returns true if the verbose flag is set.
 void iterate()
          Iterates until termination.
protected  void printDiagnostics()
          Prints diagnostic output.
 void setVerbose(boolean verbose)
          Sets the verbosity of this iterator.
protected abstract  void updateDiagnostics()
          Provides access to the diagnosticString, so that the user has flexibility over multiple methods accessing this string at different times.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface iterator.Iterable
init, isTerminated, singleIteration
 

Field Detail

diagnosticString

protected java.lang.String diagnosticString

iter

protected int iter
Constructor Detail

AbstractIterator

public AbstractIterator()
Method Detail

isVerbose

public boolean isVerbose()
Returns true if the verbose flag is set.

Returns:
the verbose flag.

iterate

public void iterate()
Description copied from interface: Iterable
Iterates until termination.

Specified by:
iterate in interface Iterable

setVerbose

public void setVerbose(boolean verbose)
Sets the verbosity of this iterator.

Parameters:
verbose - use true if the iterator is to be verbose.

printDiagnostics

protected void printDiagnostics()
Prints diagnostic output.


updateDiagnostics

protected abstract void updateDiagnostics()
Provides access to the diagnosticString, so that the user has flexibility over multiple methods accessing this string at different times.