ucar.nc2.ft.point
Class StationTimeSeriesCollectionImpl

java.lang.Object
  extended by ucar.nc2.ft.point.OneNestedPointCollectionImpl
      extended by ucar.nc2.ft.point.StationTimeSeriesCollectionImpl
All Implemented Interfaces:
FeatureCollection, NestedPointFeatureCollection, StationCollection, StationTimeSeriesFeatureCollection
Direct Known Subclasses:
CompositeStationCollection, RemoteStationCollection, StandardStationCollectionImpl

public abstract class StationTimeSeriesCollectionImpl
extends OneNestedPointCollectionImpl
implements StationTimeSeriesFeatureCollection

Abstract superclass for implementations of StationFeatureCollection. Subclass must supply StationHelper, getPointFeatureCollectionIterator().

Since:
Feb 5, 2008
Author:
caron

Field Summary
protected  PointFeatureCollectionIterator localIterator
           
protected  StationHelper stationHelper
           
 
Fields inherited from class ucar.nc2.ft.point.OneNestedPointCollectionImpl
npts
 
Constructor Summary
StationTimeSeriesCollectionImpl(java.lang.String name)
           
 
Method Summary
 LatLonRect getBoundingBox()
          Get the bounding box including all the stations.
 NestedPointFeatureCollectionIterator getNestedPointFeatureCollectionIterator(int bufferSize)
          Iterate through the collection, composed of NestedPointFeatureCollection.
 Station getStation(java.lang.String name)
          Find a Station by name.
 StationTimeSeriesFeature getStationFeature(Station s)
          Get the collection of data for a particular Station.
 java.util.List<Station> getStations()
          Get all the Stations in the collection.
 java.util.List<Station> getStations(LatLonRect boundingBox)
          Get all the Stations within a bounding box.
 java.util.List<Station> getStations(java.lang.String[] names)
          Get a list of named Stations.
 boolean hasNext()
          Use the internal iterator to check if there is another StationTimeSeriesFeature in the iteration.
 StationTimeSeriesFeature next()
          Use the internal iterator to get the next StationTimeSeriesFeature in the iteration.
 void resetIteration()
          Reset the internal iterator for another iteration over the StationTimeSeriesFeatures in this Collection.
 StationTimeSeriesFeatureCollection subset(LatLonRect boundingBox)
          Get a subsetted StationCollection based on a LatLonRect
 StationTimeSeriesFeatureCollection subset(java.util.List<Station> stations)
          Get a subsetted StationCollection based on a list of Stations.
 
Methods inherited from class ucar.nc2.ft.point.OneNestedPointCollectionImpl
flatten, getCollectionFeatureType, getName, isMultipleNested, setSize, 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.NestedPointFeatureCollection
flatten, getPointFeatureCollectionIterator, isMultipleNested, size
 
Methods inherited from interface ucar.nc2.ft.FeatureCollection
getCollectionFeatureType, getName
 

Field Detail

stationHelper

protected StationHelper stationHelper

localIterator

protected PointFeatureCollectionIterator localIterator
Constructor Detail

StationTimeSeriesCollectionImpl

public StationTimeSeriesCollectionImpl(java.lang.String name)
Method Detail

getStations

public java.util.List<Station> getStations()
Description copied from interface: StationCollection
Get all the Stations in the collection.

Specified by:
getStations in interface StationCollection
Returns:
List of Station

getStations

public java.util.List<Station> getStations(LatLonRect boundingBox)
                                    throws java.io.IOException
Description copied from interface: StationCollection
Get all the Stations within a bounding box.

Specified by:
getStations in interface StationCollection
Parameters:
boundingBox - spatial subset
Returns:
List of Station
Throws:
java.io.IOException - on i/o error

getStations

public java.util.List<Station> getStations(java.lang.String[] names)
                                    throws java.io.IOException
Description copied from interface: StationCollection
Get a list of named Stations.

Specified by:
getStations in interface StationCollection
Parameters:
names - names of stations ids
Returns:
List of coresponding Stations, skip unknown
Throws:
java.io.IOException - on i/o error

getStation

public Station getStation(java.lang.String name)
Description copied from interface: StationCollection
Find a Station by name.

Specified by:
getStation in interface StationCollection
Parameters:
name - name/id of the station
Returns:
Station or null if not found

getBoundingBox

public LatLonRect getBoundingBox()
Description copied from interface: StationCollection
Get the bounding box including all the stations.

Specified by:
getBoundingBox in interface StationCollection
Returns:
bounding box as a LatLonRect

subset

public StationTimeSeriesFeatureCollection subset(java.util.List<Station> stations)
                                          throws java.io.IOException
Description copied from interface: StationTimeSeriesFeatureCollection
Get a subsetted StationCollection based on a list of Stations.

Specified by:
subset in interface StationTimeSeriesFeatureCollection
Parameters:
stations - only contain these stations
Returns:
subsetted collection
Throws:
java.io.IOException - on i/o error

subset

public StationTimeSeriesFeatureCollection subset(LatLonRect boundingBox)
                                          throws java.io.IOException
Description copied from interface: StationTimeSeriesFeatureCollection
Get a subsetted StationCollection based on a LatLonRect

Specified by:
subset in interface NestedPointFeatureCollection
Specified by:
subset in interface StationTimeSeriesFeatureCollection
Parameters:
boundingBox - spatial subset
Returns:
subsetted collection
Throws:
java.io.IOException - on i/o error

getStationFeature

public StationTimeSeriesFeature getStationFeature(Station s)
                                           throws java.io.IOException
Description copied from interface: StationTimeSeriesFeatureCollection
Get the collection of data for a particular Station.

Specified by:
getStationFeature in interface StationTimeSeriesFeatureCollection
Parameters:
s - get data for this station, must have come from
Returns:
collection of data for this Station.
Throws:
java.io.IOException - on i/o error

getNestedPointFeatureCollectionIterator

public NestedPointFeatureCollectionIterator getNestedPointFeatureCollectionIterator(int bufferSize)
                                                                             throws java.io.IOException
Description copied from interface: NestedPointFeatureCollection
Iterate through the collection, composed of NestedPointFeatureCollection. Use this only if isMultipleNested() = true.

Specified by:
getNestedPointFeatureCollectionIterator in interface NestedPointFeatureCollection
Overrides:
getNestedPointFeatureCollectionIterator in class OneNestedPointCollectionImpl
Parameters:
bufferSize - how many bytes can be used to buffer data, use -1 to use default.
Returns:
an iterator through NestedPointFeatureCollection objects.
Throws:
java.io.IOException - on read error

hasNext

public boolean hasNext()
                throws java.io.IOException
Description copied from interface: StationTimeSeriesFeatureCollection
Use the internal iterator to check if there is another StationTimeSeriesFeature in the iteration.

Specified by:
hasNext in interface StationTimeSeriesFeatureCollection
Returns:
true is there is another StationTimeSeriesFeature in the iteration.
Throws:
java.io.IOException - on read error

next

public StationTimeSeriesFeature next()
                              throws java.io.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 interface StationTimeSeriesFeatureCollection
Returns:
the next StationTimeSeriesFeature in the iteration
Throws:
java.io.IOException - on read error

resetIteration

public void resetIteration()
                    throws java.io.IOException
Description copied from interface: StationTimeSeriesFeatureCollection
Reset the internal iterator for another iteration over the StationTimeSeriesFeatures in this Collection.

Specified by:
resetIteration in interface StationTimeSeriesFeatureCollection
Throws:
java.io.IOException - on read error