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 interface
PointFeatureIterator.Filter
A filter on PointFeatures
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Make sure that the iterator is complete, and recover resources.boolean
hasNext()
Check if another PointFeature is available.PointFeature
next()
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
close
it the first time this method returnsfalse
, as it may not get closed otherwise.- Specified by:
hasNext
in 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:
next
in 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
-