Package ucar.nc2.ft
Interface PointFeatureIterator
-
- All Superinterfaces:
AutoCloseable,Closeable,Iterator<PointFeature>
- All Known Implementing Classes:
FlattenedDatasetPointCollection.FlattenedDatasetPointIterator,PointIteratorAbstract,PointIteratorAdapter,PointIteratorEmpty,PointIteratorFiltered,PointIteratorFlatten,PointIteratorFromStructureData,PointIteratorMultidim,PointIteratorStream,StandardPointFeatureIterator
public interface PointFeatureIterator extends Closeable, Iterator<PointFeature>
An iterator over PointFeatures. Use try-with-resource to make sure resources are released:try (PointFeatureIterator iter = getIter()) { while (iter.hasNext()) process(iter.next()); }- Since:
- Feb 18, 2008
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfacePointFeatureIterator.FilterA filter on PointFeatures
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Make sure that the iterator is complete, and recover resources.booleanhasNext()Check if another PointFeature is available.PointFeaturenext()Returns the next PointFeature.-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
-
-
-
Method Detail
-
hasNext
boolean hasNext()
Check if another PointFeature is available.Since this iterator may be used in a for-each statement, implementations should
closeit the first time this method returnsfalse, as it may not get closed otherwise.- Specified by:
hasNextin interfaceIterator<PointFeature>- Returns:
- true if another PointFeature is available
- Throws:
RuntimeException- on i/o error
-
next
PointFeature next()
Returns the next PointFeature. You must call hasNext() before calling next(), even if you know it will return true.- Specified by:
nextin interfaceIterator<PointFeature>- Returns:
- the next PointFeature
- Throws:
RuntimeException- on i/o error
-
close
void close()
Make sure that the iterator is complete, and recover resources. You must complete the iteration (until hasNext() returns false) or call close(). It may be called more than once (idempotent).- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-