Package ucar.nc2.ft.point
Class PointCollectionImpl
- java.lang.Object
-
- ucar.nc2.ft.point.DsgCollectionImpl
-
- ucar.nc2.ft.point.PointCollectionImpl
-
- All Implemented Interfaces:
Iterable<PointFeature>
,DsgFeatureCollection
,PointFeatureCollection
- Direct Known Subclasses:
CompositePointCollection
,CompositeStationCollectionFlattened
,FlattenedDatasetPointCollection
,PointCollectionImpl.PointCollectionSubset
,PointCollectionStreamAbstract
,ProfileFeatureImpl
,StandardPointCollectionImpl
,StationTimeSeriesCollectionFlattened
,StationTimeSeriesFeatureImpl
,TrajectoryFeatureImpl
public abstract class PointCollectionImpl extends DsgCollectionImpl implements PointFeatureCollection
Abstract superclass for PointFeatureCollection Subclass must supply getPointFeatureIterator().- Since:
- Mar 1, 2008
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
PointCollectionImpl.PointCollectionSubset
-
Field Summary
Fields Modifier and Type Field Description protected PointFeatureIterator
localIterator
-
Constructor Summary
Constructors Modifier Constructor Description protected
PointCollectionImpl(String name, List<CoordinateAxis> coordVars)
protected
PointCollectionImpl(String name, CalendarDateUnit timeUnit, String altUnits)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finish()
Make sure that the internal iterator is complete, and recover resources.FeatureType
getCollectionFeatureType()
All features in this collection have this feature typeboolean
hasNext()
Use the internal iterator to check if there is another PointFeature in the iteration.Iterator<PointFeature>
iterator()
PointFeature
next()
Use the internal iterator to get the next PointFeature in the iteration.void
resetIteration()
Reset the internal iterator for another iteration over the PointFeatures in this Collection.PointFeatureCollection
subset(LatLonRect boundingBox, CalendarDateRange dateRange)
Subset this collection by boundingBox and/or dateRange-
Methods inherited from class ucar.nc2.ft.point.DsgCollectionImpl
getAltName, getAltUnits, getBoundingBox, getCalendarDateRange, getCoordinateVariables, getExtraVariables, getInfo, getName, getNobs, getTimeName, getTimeUnit, size
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ucar.nc2.ft.DsgFeatureCollection
getAltName, getAltUnits, getBoundingBox, getCalendarDateRange, getCoordinateVariables, getExtraVariables, getName, getTimeName, getTimeUnit, size
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface ucar.nc2.ft.PointFeatureCollection
getPointFeatureIterator
-
-
-
-
Field Detail
-
localIterator
protected PointFeatureIterator localIterator
-
-
Constructor Detail
-
PointCollectionImpl
protected PointCollectionImpl(String name, CalendarDateUnit timeUnit, String altUnits)
-
PointCollectionImpl
protected PointCollectionImpl(String name, List<CoordinateAxis> coordVars)
-
-
Method Detail
-
getCollectionFeatureType
@Nonnull public FeatureType getCollectionFeatureType()
Description copied from interface:DsgFeatureCollection
All features in this collection have this feature type- Specified by:
getCollectionFeatureType
in interfaceDsgFeatureCollection
- Returns:
- the feature type
-
subset
public PointFeatureCollection subset(LatLonRect boundingBox, CalendarDateRange dateRange)
Description copied from interface:PointFeatureCollection
Subset this collection by boundingBox and/or dateRange- Specified by:
subset
in interfacePointFeatureCollection
- Parameters:
boundingBox
- only points in this lat/lon bounding box. may be null.dateRange
- only points in this date range. may be null.- Returns:
- subsetted collection, may be null if empty
-
iterator
public Iterator<PointFeature> iterator()
- Specified by:
iterator
in interfaceIterable<PointFeature>
-
hasNext
public boolean hasNext() throws IOException
Description copied from interface:PointFeatureCollection
Use the internal iterator to check if there is another PointFeature in the iteration. Note that this is not thread-safe; use getPointFeatureIterator() for a threadsafe iterator.- Specified by:
hasNext
in interfacePointFeatureCollection
- Returns:
- true is there is another PointFeature in the iteration.
- Throws:
IOException
- on read error- See Also:
PointFeatureIterator.hasNext()
-
finish
public void finish()
Description copied from interface:PointFeatureCollection
Make sure that the internal iterator is complete, and recover resources. You must complete the iteration (until hasNext() returns false) or call finish().- Specified by:
finish
in interfacePointFeatureCollection
-
next
public PointFeature next()
Description copied from interface:PointFeatureCollection
Use the internal iterator to get the next PointFeature in the iteration. You must call hasNext() before you call this.- Specified by:
next
in interfacePointFeatureCollection
- Returns:
- the next PointFeature in the iteration
- See Also:
PointFeatureIterator.next()
-
resetIteration
public void resetIteration() throws IOException
Description copied from interface:PointFeatureCollection
Reset the internal iterator for another iteration over the PointFeatures in this Collection.- Specified by:
resetIteration
in interfacePointFeatureCollection
- Throws:
IOException
- on read error
-
-