ucar.nc2.ft.point
Class StationFeatureImpl

java.lang.Object
  extended by ucar.nc2.ft.point.PointCollectionImpl
      extended by ucar.nc2.ft.point.StationFeatureImpl
All Implemented Interfaces:
java.lang.Comparable<Station>, EarthLocation, FeatureCollection, PointFeatureCollection, Station, StationTimeSeriesFeature

public abstract class StationFeatureImpl
extends PointCollectionImpl
implements StationTimeSeriesFeature

Superclass for implementations of StationFeature: time series of data at a point Concrete subclass must implement getPointFeatureIterator();

Author:
caron

Field Summary
protected  int npts
           
protected  Station s
           
protected  DateUnit timeUnit
           
 
Fields inherited from class ucar.nc2.ft.point.PointCollectionImpl
boundingBox, dateRange, localIterator, name
 
Constructor Summary
StationFeatureImpl(Station s, DateUnit timeUnit, int npts)
           
StationFeatureImpl(java.lang.String name, java.lang.String desc, java.lang.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.
 FeatureType getCollectionFeatureType()
          All features in this collection have this feature type
 java.lang.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
 java.lang.String getName()
          Get the name of this feature collection.
 java.lang.String getWmoId()
          WMO station id.
 void setNumberPoints(int npts)
           
 int size()
          The number of points in the collection.
 StationTimeSeriesFeature subset(DateRange dateRange)
          Subset this collection by dateRange
 
Methods inherited from class ucar.nc2.ft.point.PointCollectionImpl
hasNext, next, resetIteration, setSize, subset
 
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.PointFeatureCollection
getPointFeatureIterator, hasNext, next, resetIteration, subset
 

Field Detail

s

protected Station s

timeUnit

protected DateUnit timeUnit

npts

protected int npts
Constructor Detail

StationFeatureImpl

public StationFeatureImpl(java.lang.String name,
                          java.lang.String desc,
                          java.lang.String wmoId,
                          double lat,
                          double lon,
                          double alt,
                          DateUnit timeUnit,
                          int npts)

StationFeatureImpl

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

getWmoId

public java.lang.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: PointFeatureCollection
The number of points in the collection. May not be known until after iterating through the collection.

Specified by:
size in interface PointFeatureCollection
Specified by:
size in interface StationTimeSeriesFeature
Overrides:
size in class PointCollectionImpl
Returns:
number of points in the collection, or -1 if not known.

setNumberPoints

public void setNumberPoints(int npts)

getName

public java.lang.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 PointCollectionImpl
Returns:
the name of this feature collection

getDescription

public java.lang.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.

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

getCollectionFeatureType

public FeatureType getCollectionFeatureType()
Description copied from interface: FeatureCollection
All features in this collection have this feature type

Specified by:
getCollectionFeatureType in interface FeatureCollection
Overrides:
getCollectionFeatureType in class PointCollectionImpl
Returns:
the feature type

subset

public StationTimeSeriesFeature subset(DateRange dateRange)
                                throws java.io.IOException
Description copied from interface: StationTimeSeriesFeature
Subset this collection by dateRange

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

compareTo

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