edu.indiana.iucbrf.feature.featurespec
Class AbstractFSCIterator

java.lang.Object
  extended by edu.indiana.iucbrf.feature.featurespec.AbstractFSCIterator
All Implemented Interfaces:
java.util.Iterator
Direct Known Subclasses:
FSCIterator

public abstract class AbstractFSCIterator
extends java.lang.Object
implements java.util.Iterator

A customizable (via the iteratorType parameter of the constructor, and subclassing) iterator of feature spec collections. The collections can be iterated for keys, specs, or entries (both keys and corresponding specs). The major piece of customization comes from overriding shouldVisit(). This allows the designer to avoid visiting a feature spec, under certain conditions.


Field Summary
static int ENTRY_ITERATOR
           
protected  java.util.Iterator entryIter
           
protected  FeatureSpecCollection featureSpecCollection
           
protected  int iteratorType
           
static int KEY_ITERATOR
           
protected  java.util.Map.Entry nextEntry
           
static int SPEC_ITERATOR
           
 
Constructor Summary
AbstractFSCIterator(FeatureSpecCollection featureSpecCollection, int iteratorType)
          Creates a new instance of FeatureSpecIterator
AbstractFSCIterator(FeatureSpecCollection featureSpecCollection, int iteratorType, java.util.Iterator orderedAllEntryIterator)
           
 
Method Summary
 boolean hasNext()
           
 java.lang.Object next()
           
 void remove()
           
abstract  boolean shouldVisit(FeatureKey featureKey)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPEC_ITERATOR

public static final int SPEC_ITERATOR
See Also:
Constant Field Values

KEY_ITERATOR

public static final int KEY_ITERATOR
See Also:
Constant Field Values

ENTRY_ITERATOR

public static final int ENTRY_ITERATOR
See Also:
Constant Field Values

iteratorType

protected int iteratorType

featureSpecCollection

protected FeatureSpecCollection featureSpecCollection

entryIter

protected java.util.Iterator entryIter

nextEntry

protected java.util.Map.Entry nextEntry
Constructor Detail

AbstractFSCIterator

public AbstractFSCIterator(FeatureSpecCollection featureSpecCollection,
                           int iteratorType)
Creates a new instance of FeatureSpecIterator


AbstractFSCIterator

public AbstractFSCIterator(FeatureSpecCollection featureSpecCollection,
                           int iteratorType,
                           java.util.Iterator orderedAllEntryIterator)
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator

next

public java.lang.Object next()
Specified by:
next in interface java.util.Iterator

remove

public void remove()
Specified by:
remove in interface java.util.Iterator

shouldVisit

public abstract boolean shouldVisit(FeatureKey featureKey)