Package ucar.nc2.ft.point
Class PointIteratorFromStructureData
- java.lang.Object
-
- ucar.nc2.ft.point.PointIteratorAbstract
-
- ucar.nc2.ft.point.PointIteratorFromStructureData
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterator<PointFeature>
,PointFeatureIterator
- Direct Known Subclasses:
StandardPointFeatureIterator
public abstract class PointIteratorFromStructureData extends PointIteratorAbstract
A PointFeatureIterator which uses a StructureDataIterator to iterate over members of a Structure, with optional filtering and calculation of time range and bounding box.Subclass must implement makeFeature() to turn the StructureData into a PointFeature.
- Since:
- Feb 29, 2008
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface ucar.nc2.ft.PointFeatureIterator
PointFeatureIterator.Filter
-
-
Field Summary
-
Fields inherited from class ucar.nc2.ft.point.PointIteratorAbstract
calcBounds, info
-
-
Constructor Summary
Constructors Constructor Description PointIteratorFromStructureData(StructureDataIterator structIter, PointFeatureIterator.Filter filter)
Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete 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.protected abstract PointFeature
makeFeature(int recnum, StructureData sdata)
PointFeature
next()
Returns the next PointFeature.-
Methods inherited from class ucar.nc2.ft.point.PointIteratorAbstract
calcBounds, finishCalcBounds, setCalculateBounds
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
-
-
-
Constructor Detail
-
PointIteratorFromStructureData
public PointIteratorFromStructureData(StructureDataIterator structIter, PointFeatureIterator.Filter filter)
Constructor- Parameters:
structIter
- original iteratorfilter
- optional filter
-
-
Method Detail
-
makeFeature
protected abstract PointFeature makeFeature(int recnum, StructureData sdata) throws IOException
- Throws:
IOException
-
hasNext
public boolean hasNext()
Description copied from interface:PointFeatureIterator
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.- Returns:
- true if another PointFeature is available
-
next
public PointFeature next()
Description copied from interface:PointFeatureIterator
Returns the next PointFeature. You must call hasNext() before calling next(), even if you know it will return true.- Returns:
- the next PointFeature
-
close
public void close()
Description copied from interface:PointFeatureIterator
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).
-
-