ucar.nc2.ft.point
Class StationProfileFeatureImpl

java.lang.Object
  extended by ucar.nc2.ft.point.OneNestedPointCollectionImpl
      extended by ucar.nc2.ft.point.StationProfileFeatureImpl
All Implemented Interfaces:
Comparable<Station>, FeatureCollection, NestedPointFeatureCollection, StationProfileFeature, EarthLocation, Station

public abstract class StationProfileFeatureImpl
extends OneNestedPointCollectionImpl
implements StationProfileFeature

Abstract superclass for implementations of StationProfileFeature. Subclass must implement getPointFeatureCollectionIterator();

Since:
Feb 29, 2008
Author:
caron

Field Summary
protected  PointFeatureCollectionIterator localIterator
           
protected  Station s
           
protected  int timeSeriesNpts
           
protected  DateUnit timeUnit
           
 
Fields inherited from class ucar.nc2.ft.point.OneNestedPointCollectionImpl
npts
 
Constructor Summary
StationProfileFeatureImpl(Station s, DateUnit timeUnit, int npts)
           
StationProfileFeatureImpl(String name, String desc, String wmoId, double lat, double lon, double alt, DateUnit timeUnit, int npts)
           
 
Method Summary
 int compareTo(Station so)
           
 double getAltitude()
           
 String getDescription()
           
 double getLatitude()
           
 LatLonPoint getLatLon()
           
 double getLongitude()
           
 String getName()
          Get the name of this feature collection.
 String getWmoId()
           
 boolean hasNext()
          Use the internal iterator to check if there is another ProfileFeature in the iteration.
 boolean isMissing()
           
 ProfileFeature next()
          Use the internal iterator to get the next ProfileFeature in the iteration.
 void resetIteration()
          Reset the internal iterator for another iteration over the ProfileFeature in this Collection.
 int size()
          The number of elements in the collection.
 StationProfileFeature subset(DateRange dateRange)
          Subset this collection by dateRange
 StationProfileFeature subset(LatLonRect dateRange)
          Get a subsetted NestedPointFeatureCollection based on a LatLonRect
 
Methods inherited from class ucar.nc2.ft.point.OneNestedPointCollectionImpl
flatten, getCollectionFeatureType, getNestedPointFeatureCollectionIterator, isMultipleNested, setSize
 
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.StationProfileFeature
getProfileByDate, getTimes
 
Methods inherited from interface ucar.nc2.ft.NestedPointFeatureCollection
flatten, getNestedPointFeatureCollectionIterator, getPointFeatureCollectionIterator, isMultipleNested
 
Methods inherited from interface ucar.nc2.ft.FeatureCollection
getCollectionFeatureType
 

Field Detail

timeUnit

protected DateUnit timeUnit

timeSeriesNpts

protected int timeSeriesNpts

s

protected Station s

localIterator

protected PointFeatureCollectionIterator localIterator
Constructor Detail

StationProfileFeatureImpl

public StationProfileFeatureImpl(String name,
                                 String desc,
                                 String wmoId,
                                 double lat,
                                 double lon,
                                 double alt,
                                 DateUnit timeUnit,
                                 int npts)

StationProfileFeatureImpl

public StationProfileFeatureImpl(Station s,
                                 DateUnit timeUnit,
                                 int npts)
Method Detail

getWmoId

public String getWmoId()
Specified by:
getWmoId in interface Station

size

public int size()
Description copied from interface: NestedPointFeatureCollection
The number of elements in the collection. May not be known until after iterating through the collection.

Specified by:
size in interface NestedPointFeatureCollection
Specified by:
size in interface StationProfileFeature
Overrides:
size in class OneNestedPointCollectionImpl
Returns:
number of elements in the collection, or -1 if not known.

getName

public String getName()
Description copied from interface: FeatureCollection
Get the name of this feature collection.

Specified by:
getName in interface FeatureCollection
Specified by:
getName in interface Station
Overrides:
getName in class OneNestedPointCollectionImpl
Returns:
the name of this feature collection

getDescription

public String getDescription()
Specified by:
getDescription in interface Station

getLatitude

public double getLatitude()
Specified by:
getLatitude in interface EarthLocation

getLongitude

public double getLongitude()
Specified by:
getLongitude in interface EarthLocation

getAltitude

public double getAltitude()
Specified by:
getAltitude in interface EarthLocation

getLatLon

public LatLonPoint getLatLon()
Specified by:
getLatLon in interface EarthLocation

isMissing

public boolean isMissing()
Specified by:
isMissing in interface EarthLocation

hasNext

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

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

next

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

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

resetIteration

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

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

compareTo

public int compareTo(Station so)
Specified by:
compareTo in interface Comparable<Station>

subset

public StationProfileFeature subset(DateRange dateRange)
                             throws IOException
Description copied from interface: StationProfileFeature
Subset this collection by dateRange

Specified by:
subset in interface StationProfileFeature
Parameters:
dateRange - only points in this date range. may be null.
Returns:
subsetted collection, may be null if empty
Throws:
IOException - on read error

subset

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

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


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