org.geotools.feature
Class FeatureReaderIterator<F extends Feature>

Object
  extended by FeatureReaderIterator<F>
All Implemented Interfaces:
Closeable, Iterator<F>

public class FeatureReaderIterator<F extends Feature>
extends Object
implements Iterator<F>, Closeable

An iterator that wraps around a FeatureReader.

The Iterator's hasNext() will return false if the wrapped feature reader's hasNext method throws an exception. If next() throws an exception a NoSuchElementException will be thrown.

close() shall be called before disposing the iterator. Before propagating an exception from next() or eating an exception from the underlying feature reader at hasNext(), this iterator will auto-close.

Author:
jeichar, Jody Garnett, Gabriel Roldan

Constructor Summary
FeatureReaderIterator(FeatureReader<? extends FeatureType,F> reader)
           
 
Method Summary
 void close()
          Close the reader please.
 boolean hasNext()
           
 F next()
           
 void remove()
          If this is a problem, a different iterator can be made based on FeatureWriter
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeatureReaderIterator

public FeatureReaderIterator(FeatureReader<? extends FeatureType,F> reader)
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<F extends Feature>

next

public F next()
Specified by:
next in interface Iterator<F extends Feature>

remove

public void remove()
If this is a problem, a different iterator can be made based on FeatureWriter

Specified by:
remove in interface Iterator<F extends Feature>

close

public void close()
Close the reader please.

Specified by:
close in interface Closeable


Copyright © 1996-2014 Geotools. All Rights Reserved.