Package ucar.nc2.ft.point
Class StationTimeSeriesCollectionImpl
- java.lang.Object
-
- ucar.nc2.ft.point.DsgCollectionImpl
-
- ucar.nc2.ft.point.PointFeatureCCImpl
-
- ucar.nc2.ft.point.StationTimeSeriesCollectionImpl
-
- All Implemented Interfaces:
Iterable<StationTimeSeriesFeature>
,DsgFeatureCollection
,PointFeatureCC
,StationFeatureCollection
,StationTimeSeriesFeatureCollection
- Direct Known Subclasses:
CompositeStationCollection
,StandardStationCollectionImpl
,StationCollectionStream
public abstract class StationTimeSeriesCollectionImpl extends PointFeatureCCImpl implements StationTimeSeriesFeatureCollection
Abstract superclass for implementations of StationFeatureCollection. Subclass must supply createStationHelper, may need to override getPointFeatureCollectionIterator().- Since:
- Feb 5, 2008
-
-
Field Summary
Fields Modifier and Type Field Description protected PointFeatureCollectionIterator
localIterator
-
Fields inherited from class ucar.nc2.ft.point.PointFeatureCCImpl
collectionFeatureType
-
-
Constructor Summary
Constructors Constructor Description StationTimeSeriesCollectionImpl(String name, List<CoordinateAxis> coordVars)
StationTimeSeriesCollectionImpl(String name, CalendarDateUnit timeUnit, String altUnits)
-
Method Summary
-
Methods inherited from class ucar.nc2.ft.point.PointFeatureCCImpl
getCollectionFeatureType
-
Methods inherited from class ucar.nc2.ft.point.DsgCollectionImpl
getAltName, getAltUnits, 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, getCalendarDateRange, getCollectionFeatureType, getCoordinateVariables, getExtraVariables, getName, getTimeName, getTimeUnit, size
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
localIterator
protected PointFeatureCollectionIterator localIterator
-
-
Constructor Detail
-
StationTimeSeriesCollectionImpl
public StationTimeSeriesCollectionImpl(String name, CalendarDateUnit timeUnit, String altUnits)
-
StationTimeSeriesCollectionImpl
public StationTimeSeriesCollectionImpl(String name, List<CoordinateAxis> coordVars)
-
-
Method Detail
-
getStationHelper
protected StationHelper getStationHelper()
-
createStationHelper
protected abstract StationHelper createStationHelper() throws IOException
- Throws:
IOException
-
getBoundingBox
public LatLonRect getBoundingBox()
Description copied from interface:DsgFeatureCollection
The boundingBox for the FeatureCollection. May not be known until after iterating through the collection.- Specified by:
getBoundingBox
in interfaceDsgFeatureCollection
- Overrides:
getBoundingBox
in classDsgCollectionImpl
- Returns:
- the lat/lon boundingBox for the entire collection, or null if unknown.
-
getStationFeatures
public List<StationFeature> getStationFeatures()
- Specified by:
getStationFeatures
in interfaceStationFeatureCollection
- Specified by:
getStationFeatures
in interfaceStationTimeSeriesFeatureCollection
-
getStationFeatures
public List<StationFeature> getStationFeatures(List<String> stnNames)
- Specified by:
getStationFeatures
in interfaceStationFeatureCollection
- Specified by:
getStationFeatures
in interfaceStationTimeSeriesFeatureCollection
-
getStationFeatures
public List<StationFeature> getStationFeatures(LatLonRect boundingBox)
- Specified by:
getStationFeatures
in interfaceStationFeatureCollection
- Specified by:
getStationFeatures
in interfaceStationTimeSeriesFeatureCollection
-
findStationFeature
public StationFeature findStationFeature(String name)
- Specified by:
findStationFeature
in interfaceStationFeatureCollection
- Specified by:
findStationFeature
in interfaceStationTimeSeriesFeatureCollection
-
getStationTimeSeriesFeature
public StationTimeSeriesFeature getStationTimeSeriesFeature(StationFeature s)
- Specified by:
getStationTimeSeriesFeature
in interfaceStationTimeSeriesFeatureCollection
-
subset
public StationTimeSeriesFeatureCollection subset(LatLonRect boundingBox)
- Specified by:
subset
in interfaceStationTimeSeriesFeatureCollection
-
subset
public StationTimeSeriesFeatureCollection subset(LatLonRect boundingBox, CalendarDateRange dateRange)
- Specified by:
subset
in interfaceStationTimeSeriesFeatureCollection
-
subset
public StationTimeSeriesFeatureCollection subset(List<StationFeature> stations)
- Specified by:
subset
in interfaceStationTimeSeriesFeatureCollection
-
subset
public StationTimeSeriesFeatureCollection subset(List<StationFeature> stnsWanted, CalendarDateRange dateRange)
- Specified by:
subset
in interfaceStationTimeSeriesFeatureCollection
-
subsetFeatures
public StationTimeSeriesFeatureCollection subsetFeatures(List<StationFeature> stationsFeatures)
- Specified by:
subsetFeatures
in interfaceStationTimeSeriesFeatureCollection
-
flatten
public PointFeatureCollection flatten(List<String> stationNames, CalendarDateRange dateRange, List<VariableSimpleIF> varList)
Description copied from interface:StationTimeSeriesFeatureCollection
Flatten into a PointFeatureCollection, discarding connectedness information.- Specified by:
flatten
in interfaceStationTimeSeriesFeatureCollection
- Parameters:
stationNames
- only contain these stations; if null or empty use alldateRange
- only points in this date range. may be null.varList
- only these member variables. may be null. currently ignored- Returns:
- a PointFeatureCollection, may be null if its empty.
-
flatten
public PointFeatureCollection flatten(LatLonRect boundingBox, CalendarDateRange dateRange) throws IOException
- Specified by:
flatten
in interfaceStationTimeSeriesFeatureCollection
- Throws:
IOException
-
getStationFeature
public StationFeature getStationFeature(PointFeature flatPointFeature)
- Specified by:
getStationFeature
in interfaceStationTimeSeriesFeatureCollection
-
iterator
public Iterator<StationTimeSeriesFeature> iterator()
- Specified by:
iterator
in interfaceIterable<StationTimeSeriesFeature>
-
getCollectionIterator
public IOIterator<PointFeatureCollection> getCollectionIterator()
Description copied from interface:PointFeatureCC
General way to handle iterations on all classes that implement this interface. Generally, one uses class specific foreach- Specified by:
getCollectionIterator
in interfacePointFeatureCC
- Returns:
- Iterator over PointFeatureCollection which may throw an IOException
-
getPointFeatureCollectionIterator
public PointFeatureCollectionIterator getPointFeatureCollectionIterator()
- Specified by:
getPointFeatureCollectionIterator
in interfaceStationTimeSeriesFeatureCollection
-
hasNext
public boolean hasNext() throws IOException
Description copied from interface:StationTimeSeriesFeatureCollection
Use the internal iterator to check if there is another StationTimeSeriesFeature in the iteration.- Specified by:
hasNext
in interfaceStationTimeSeriesFeatureCollection
- Returns:
- true is there is another StationTimeSeriesFeature in the iteration.
- Throws:
IOException
- on read error
-
finish
public void finish()
Description copied from interface:StationTimeSeriesFeatureCollection
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 interfaceStationTimeSeriesFeatureCollection
- See Also:
PointFeatureIterator.close()
-
next
public StationTimeSeriesFeature next() throws IOException
Description copied from interface:StationTimeSeriesFeatureCollection
Use the internal iterator to get the next StationTimeSeriesFeature in the iteration. You must call hasNext() before you call this.- Specified by:
next
in interfaceStationTimeSeriesFeatureCollection
- Returns:
- the next StationTimeSeriesFeature in the iteration
- Throws:
IOException
- on read error
-
resetIteration
public void resetIteration()
Description copied from interface:StationTimeSeriesFeatureCollection
Reset the internal iterator for another iteration over the StationTimeSeriesFeatures in this Collection.- Specified by:
resetIteration
in interfaceStationTimeSeriesFeatureCollection
-
-