Package org.geotools.feature
Class FeatureReaderIterator<F extends Feature>
- Object
-
- FeatureReaderIterator<F>
-
- All Implemented Interfaces:
Closeable,AutoCloseable,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 fromnext()or eating an exception from the underlying feature reader athasNext(), this iterator will auto-close.- Author:
- jeichar, Jody Garnett, Gabriel Roldan
-
-
Constructor Summary
Constructors Constructor Description FeatureReaderIterator(FeatureReader<? extends FeatureType,F> reader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the reader please.booleanhasNext()Fnext()voidremove()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
-
Methods inherited from interface Iterator
forEachRemaining
-
-
-
-
Constructor Detail
-
FeatureReaderIterator
public FeatureReaderIterator(FeatureReader<? extends FeatureType,F> reader)
-
-
Method Detail
-
remove
public void remove()
If this is a problem, a different iterator can be made based on FeatureWriter
-
close
public void close()
Close the reader please.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-