ucar.nc2.ft.point
Class StationProfileCollectionImpl

java.lang.Object
  extended by ucar.nc2.ft.point.MultipleNestedPointCollectionImpl
      extended by ucar.nc2.ft.point.StationProfileCollectionImpl
All Implemented Interfaces:
FeatureCollection, NestedPointFeatureCollection, StationCollection, StationProfileFeatureCollection
Direct Known Subclasses:
StandardStationProfileCollectionImpl

public abstract class StationProfileCollectionImpl
extends MultipleNestedPointCollectionImpl
implements StationProfileFeatureCollection

Abstract superclass for StationProfileFeatureCollection Subclasses must implement getNestedPointFeatureCollection

Since:
Mar 20, 2008
Author:
caron

Field Summary
protected  NestedPointFeatureCollectionIterator localIterator
           
protected  StationHelper stationHelper
           
 
Fields inherited from class ucar.nc2.ft.point.MultipleNestedPointCollectionImpl
name
 
Constructor Summary
StationProfileCollectionImpl(String name)
           
 
Method Summary
 int compareTo(Station so)
           
 LatLonRect getBoundingBox()
          Get the bounding box including all the stations.
 PointFeatureCollectionIterator getPointFeatureCollectionIterator(int bufferSize)
          Iterate through the collection, composed of PointFeatureCollection.
 Station getStation(String name)
          Find a Station by name.
 StationProfileFeature getStationProfileFeature(Station s)
          Get the StationProfileFeature for a specific Station.
 List<Station> getStations()
          Get all the Stations in the collection.
 List<Station> getStations(LatLonRect boundingBox)
          Get all the Stations within a bounding box.
 List<Station> getStations(List<String> stnNames)
          Translate list of station names to list of Stations.
 boolean hasNext()
          Use the internal iterator to check if there is another StationProfileFeature in the iteration.
protected abstract  void initStationHelper()
           
 StationProfileFeature next()
          Use the internal iterator to get the next StationProfileFeature in the iteration.
 void resetIteration()
          Reset the internal iterator for another iteration over the StationProfileFeature in this Collection.
 StationProfileCollectionImpl subset(LatLonRect boundingBox)
          Get a subsetted NestedPointFeatureCollection based on a LatLonRect
 StationProfileCollectionImpl subset(List<Station> stations)
          Get a subsetted StationProfileFeatureCollection
 
Methods inherited from class ucar.nc2.ft.point.MultipleNestedPointCollectionImpl
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, getNestedPointFeatureCollectionIterator, isMultipleNested, size
 
Methods inherited from interface ucar.nc2.ft.FeatureCollection
getCollectionFeatureType, getName
 

Field Detail

stationHelper

protected StationHelper stationHelper

localIterator

protected NestedPointFeatureCollectionIterator localIterator
Constructor Detail

StationProfileCollectionImpl

public StationProfileCollectionImpl(String name)
Method Detail

initStationHelper

protected abstract void initStationHelper()

getStations

public 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 List<Station> getStations(List<String> stnNames)
Description copied from interface: StationCollection
Translate list of station names to list of Stations. Skip any not found

Specified by:
getStations in interface StationCollection
Parameters:
stnNames - list of stnNames
Returns:
corresponding list of Stations

getStations

public List<Station> getStations(LatLonRect boundingBox)
                          throws 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:
IOException - on i/o error

getStation

public Station getStation(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 StationProfileCollectionImpl subset(List<Station> stations)
                                    throws IOException
Description copied from interface: StationProfileFeatureCollection
Get a subsetted StationProfileFeatureCollection

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

subset

public StationProfileCollectionImpl subset(LatLonRect boundingBox)
                                    throws IOException
Description copied from interface: NestedPointFeatureCollection
Get a subsetted NestedPointFeatureCollection based on a LatLonRect

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

getStationProfileFeature

public StationProfileFeature getStationProfileFeature(Station s)
                                               throws IOException
Description copied from interface: StationProfileFeatureCollection
Get the StationProfileFeature for a specific Station.

Specified by:
getStationProfileFeature in interface StationProfileFeatureCollection
Parameters:
s - at this station
Returns:
collection of data for this Station.
Throws:
IOException - on i/o error

getPointFeatureCollectionIterator

public PointFeatureCollectionIterator getPointFeatureCollectionIterator(int bufferSize)
                                                                 throws IOException
Description copied from interface: NestedPointFeatureCollection
Iterate through the collection, composed of PointFeatureCollection. Use this only if isMultipleNested() = false.

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

hasNext

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

Specified by:
hasNext in interface StationProfileFeatureCollection
Returns:
true is there is another StationProfileFeature in the iteration.
Throws:
IOException - on read error

next

public StationProfileFeature next()
                           throws IOException
Description copied from interface: StationProfileFeatureCollection
Use the internal iterator to get the next StationProfileFeature in the iteration. You must call hasNext() before you call this.

Specified by:
next in interface StationProfileFeatureCollection
Returns:
the next StationProfileFeature in the iteration
Throws:
IOException - on read error

resetIteration

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

Specified by:
resetIteration in interface StationProfileFeatureCollection
Throws:
IOException - on read error

compareTo

public int compareTo(Station so)


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.