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 classPointCollectionImpl.PointCollectionSubset
-
Field Summary
Fields Modifier and Type Field Description protected PointFeatureIteratorlocalIterator
-
Constructor Summary
Constructors Modifier Constructor Description protectedPointCollectionImpl(String name, CalendarDateUnit timeUnit, String altUnits)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfinish()Make sure that the internal iterator is complete, and recover resources.FeatureTypegetCollectionFeatureType()All features in this collection have this feature typebooleanhasNext()Use the internal iterator to check if there is another PointFeature in the iteration.Iterator<PointFeature>iterator()PointFeaturenext()Use the internal iterator to get the next PointFeature in the iteration.voidresetIteration()Reset the internal iterator for another iteration over the PointFeatures in this Collection.PointFeatureCollectionsubset(LatLonRect boundingBox, CalendarDateRange dateRange)Subset this collection by boundingBox and/or dateRange-
Methods inherited from class ucar.nc2.ft.point.DsgCollectionImpl
getAltUnits, getBoundingBox, getCalendarDateRange, getExtraVariables, getInfo, getName, getNobs, 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
getAltUnits, getBoundingBox, getCalendarDateRange, getExtraVariables, getName, 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)
-
-
Method Detail
-
getCollectionFeatureType
@Nonnull public FeatureType getCollectionFeatureType()
Description copied from interface:DsgFeatureCollectionAll features in this collection have this feature type- Specified by:
getCollectionFeatureTypein interfaceDsgFeatureCollection- Returns:
- the feature type
-
subset
public PointFeatureCollection subset(LatLonRect boundingBox, CalendarDateRange dateRange)
Description copied from interface:PointFeatureCollectionSubset this collection by boundingBox and/or dateRange- Specified by:
subsetin 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:
iteratorin interfaceIterable<PointFeature>
-
hasNext
public boolean hasNext() throws IOExceptionDescription copied from interface:PointFeatureCollectionUse 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:
hasNextin 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:PointFeatureCollectionMake sure that the internal iterator is complete, and recover resources. You must complete the iteration (until hasNext() returns false) or call finish().- Specified by:
finishin interfacePointFeatureCollection
-
next
public PointFeature next()
Description copied from interface:PointFeatureCollectionUse the internal iterator to get the next PointFeature in the iteration. You must call hasNext() before you call this.- Specified by:
nextin interfacePointFeatureCollection- Returns:
- the next PointFeature in the iteration
- See Also:
PointFeatureIterator.next()
-
resetIteration
public void resetIteration() throws IOExceptionDescription copied from interface:PointFeatureCollectionReset the internal iterator for another iteration over the PointFeatures in this Collection.- Specified by:
resetIterationin interfacePointFeatureCollection- Throws:
IOException- on read error
-
-