schmitzm.geotools.feature
Class PipedFeatureIterator

java.lang.Object
  extended by schmitzm.geotools.feature.PipedFeatureIterator
All Implemented Interfaces:
Iterator<SimpleFeature>

public class PipedFeatureIterator
extends Object
implements Iterator<SimpleFeature>

This class is a workaround since FeatureIterator does not implement Iterator. This class simply pipes all function calls to the FeatureIterator specified in the constructor, but can be used with the Java standard Iterator interface.

Author:
Martin Schmitz

Field Summary
protected   iterator
          Holds the FeatureIterator which is piped.
 
Constructor Summary
PipedFeatureIterator( iterator)
          Creates a new iterator.
 
Method Summary
 boolean hasNext()
          Checks whether a next element exists.
 SimpleFeature next()
          Returns the next SimpleFeature;
 void remove()
          Not supported, because the FeatureIterator does not support this functionality.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iterator

protected  iterator
Holds the FeatureIterator which is piped.

Constructor Detail

PipedFeatureIterator

public PipedFeatureIterator( iterator)
Creates a new iterator.

Parameters:
iterator - FeatureIterator which is piped
Method Detail

hasNext

public boolean hasNext()
Checks whether a next element exists.

Specified by:
hasNext in interface Iterator<SimpleFeature>

next

public SimpleFeature next()
Returns the next SimpleFeature;

Specified by:
next in interface Iterator<SimpleFeature>

remove

public void remove()
Not supported, because the FeatureIterator does not support this functionality.

Specified by:
remove in interface Iterator<SimpleFeature>
Throws:
UnsupportedOperationException - always