Package ucar.nc2.ft.point
Class PointIteratorAdapter
- java.lang.Object
-
- ucar.nc2.ft.point.PointIteratorAbstract
-
- ucar.nc2.ft.point.PointIteratorAdapter
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterator<PointFeature>
,PointFeatureIterator
public class PointIteratorAdapter extends PointIteratorAbstract
Adapts anIterator
<PointFeature
> to aPointFeatureIterator
. The original iterator gains bounds calculation and compatibility with the rest of the Point Feature API.- Since:
- 2014/08/30
-
-
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 PointIteratorAdapter(Iterator<? extends PointFeature> pointIter)
Creates aPointFeatureIterator
from the supplied basic iterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Finishes bounds calculation,if it has been enabled
.boolean
hasNext()
Returnstrue
if the iteration has more elements.PointFeature
next()
Returns the next element in the iteration.-
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
-
PointIteratorAdapter
public PointIteratorAdapter(Iterator<? extends PointFeature> pointIter)
Creates aPointFeatureIterator
from the supplied basic iterator.- Parameters:
pointIter
- a basic iterator over point features.
-
-
Method Detail
-
hasNext
public boolean hasNext()
Returnstrue
if the iteration has more elements. (In other words, returnstrue
ifnext()
would return an element rather than throwing an exception.) This method is idempotent, meaning that when it is called repeatedly without an interveningnext()
, calls after the first will have no effect.- Returns:
true
if the iteration has more elements,false
otherwise. Afalse
return valuefinishes
this iteration.
-
next
public PointFeature next() throws NoSuchElementException
Returns the next element in the iteration.- Returns:
- the next element in the iteration
- Throws:
NoSuchElementException
- if the iteration has no more elements.
-
close
public void close()
Finishes bounds calculation,if it has been enabled
. Do not attempt to retrieve bounds information before this method has been invoked orhasNext()
returnsfalse
. This method is idempotent, meaning that calls after the first have no effect.
-
-