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()
          altitude in meters; missing = NaN.
 String getDescription()
          Station description
 double getLatitude()
          latitude in decimal degrees north
 LatLonPoint getLatLon()
          Get the lat/lon location
 double getLongitude()
          longitude in decimal degrees east
 String getName()
          Get the name of this feature collection.
 String getWmoId()
          WMO station id.
 boolean hasNext()
          Use the internal iterator to check if there is another ProfileFeature in the iteration.
 boolean isMissing()
          Are either lat or lon missing?
 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()
Description copied from interface: Station
WMO station id.

Specified by:
getWmoId in interface Station
Returns:
WMO station id, or null.

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()
Description copied from interface: Station
Station description

Specified by:
getDescription in interface Station
Returns:
station description

getLatitude

public double getLatitude()
Description copied from interface: EarthLocation
latitude in decimal degrees north

Specified by:
getLatitude in interface EarthLocation
Returns:
latitude in decimal degrees north

getLongitude

public double getLongitude()
Description copied from interface: EarthLocation
longitude in decimal degrees east

Specified by:
getLongitude in interface EarthLocation
Returns:
longitude in decimal degrees east

getAltitude

public double getAltitude()
Description copied from interface: EarthLocation
altitude in meters; missing = NaN. LOOK: what is the reference surface ? for now assume mean sea level ???

Specified by:
getAltitude in interface EarthLocation
Returns:
altitude in meters; missing = NaN.

getLatLon

public LatLonPoint getLatLon()
Description copied from interface: EarthLocation
Get the lat/lon location

Specified by:
getLatLon in interface EarthLocation
Returns:
lat/lon location

isMissing

public boolean isMissing()
Description copied from interface: EarthLocation
Are either lat or lon missing?

Specified by:
isMissing in interface EarthLocation
Returns:
true if lat or lon is missing

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.