Package ucar.nc2.ft.point
Class StationProfileFeatureImpl
- java.lang.Object
-
- ucar.nc2.ft.point.DsgCollectionImpl
-
- ucar.nc2.ft.point.PointFeatureCCImpl
-
- ucar.nc2.ft.point.StationProfileFeatureImpl
-
- All Implemented Interfaces:
Comparable<Station>
,Iterable<ProfileFeature>
,DsgFeatureCollection
,StationFeature
,PointFeatureCC
,StationProfileFeature
,EarthLocation
,Station
- Direct Known Subclasses:
StationProfileFeatureImpl.StationProfileFeatureSubset
public abstract class StationProfileFeatureImpl extends PointFeatureCCImpl implements StationProfileFeature
Abstract superclass for implementations of StationProfileFeature. Subclass must implement getPointFeatureCollectionIterator();- Since:
- Feb 29, 2008
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StationProfileFeatureImpl.StationProfileFeatureSubset
-
Field Summary
Fields Modifier and Type Field Description protected PointFeatureCollectionIterator
localIterator
protected Station
station
protected int
timeSeriesNpts
-
Fields inherited from class ucar.nc2.ft.point.PointFeatureCCImpl
collectionFeatureType
-
-
Constructor Summary
Constructors Constructor Description StationProfileFeatureImpl(String name, String desc, String wmoId, double lat, double lon, double alt, CalendarDateUnit timeUnit, String altUnits, int npts)
StationProfileFeatureImpl(Station s, List<CoordinateAxis> coords, int npts)
StationProfileFeatureImpl(Station s, CalendarDateUnit timeUnit, String altUnits, int npts)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Station so)
boolean
equals(Object o)
double
getAltitude()
Returns the altitude in some unit.String
getDescription()
Station descriptiondouble
getLatitude()
Returns the latitude in some unit.LatLonPoint
getLatLon()
Get the lat/lon locationdouble
getLongitude()
Returns the longitude in some unit.String
getName()
Get the name of this feature collection.int
getNobs()
get Number of obs at this stationString
getWmoId()
WMO station id.int
hashCode()
boolean
hasNext()
Use the internal iterator to check if there is another ProfileFeature in the iteration.boolean
isMissing()
Are either lat or lon missing?Iterator<ProfileFeature>
iterator()
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 Features in the collection.StationProfileFeature
subset(CalendarDateRange dateRange)
Subset this collection by dateRangeStationProfileFeature
subset(LatLonRect boundingBox)
-
Methods inherited from class ucar.nc2.ft.point.PointFeatureCCImpl
getCollectionFeatureType
-
Methods inherited from class ucar.nc2.ft.point.DsgCollectionImpl
getAltName, getAltUnits, getBoundingBox, getCalendarDateRange, getCoordinateVariables, getExtraVariables, getInfo, getTimeName, getTimeUnit
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ucar.nc2.ft.DsgFeatureCollection
getAltName, getAltUnits, getBoundingBox, getCalendarDateRange, getCollectionFeatureType, getCoordinateVariables, getExtraVariables, getTimeName, getTimeUnit
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface ucar.nc2.ft.PointFeatureCC
getCollectionIterator
-
Methods inherited from interface ucar.nc2.ft.StationProfileFeature
getFeatureData, getPointFeatureCollectionIterator, getProfileByDate, getTimes
-
-
-
-
Field Detail
-
timeSeriesNpts
protected int timeSeriesNpts
-
station
protected Station station
-
localIterator
protected PointFeatureCollectionIterator localIterator
-
-
Constructor Detail
-
StationProfileFeatureImpl
public StationProfileFeatureImpl(String name, String desc, String wmoId, double lat, double lon, double alt, CalendarDateUnit timeUnit, String altUnits, int npts)
-
StationProfileFeatureImpl
public StationProfileFeatureImpl(Station s, CalendarDateUnit timeUnit, String altUnits, int npts)
-
StationProfileFeatureImpl
public StationProfileFeatureImpl(Station s, List<CoordinateAxis> coords, int npts)
-
-
Method Detail
-
getNobs
public int getNobs()
Description copied from interface:Station
get Number of obs at this station- Specified by:
getNobs
in interfaceStation
- Overrides:
getNobs
in classDsgCollectionImpl
- Returns:
- Number of obs or -1 if unknown
-
size
public int size()
Description copied from interface:DsgFeatureCollection
The number of Features in the collection. May not be known until after iterating through the collection.- Specified by:
size
in interfaceDsgFeatureCollection
- Specified by:
size
in interfaceStationProfileFeature
- Overrides:
size
in classDsgCollectionImpl
- Returns:
- number of elements in the collection, or -1 if not known.
-
getName
@Nonnull public String getName()
Description copied from interface:DsgFeatureCollection
Get the name of this feature collection.- Specified by:
getName
in interfaceDsgFeatureCollection
- Specified by:
getName
in interfaceStation
- Overrides:
getName
in classDsgCollectionImpl
- Returns:
- the name of this feature collection
-
getDescription
public String getDescription()
Description copied from interface:Station
Station description- Specified by:
getDescription
in interfaceStation
- Returns:
- station description or null
-
getLatitude
public double getLatitude()
Description copied from interface:EarthLocation
Returns the latitude in some unit. The unit is very likely decimal degrees north, but we don't enforce that anywhere.- Specified by:
getLatitude
in interfaceEarthLocation
- Returns:
- the latitude in some unit.
-
getLongitude
public double getLongitude()
Description copied from interface:EarthLocation
Returns the longitude in some unit. The unit is very likely decimal degrees east, but we don't enforce that anywhere.- Specified by:
getLongitude
in interfaceEarthLocation
- Returns:
- the longitude in some unit.
-
getAltitude
public double getAltitude()
Description copied from interface:EarthLocation
Returns the altitude in some unit.- Specified by:
getAltitude
in interfaceEarthLocation
- Returns:
- the altitude in some unit. A value of
Double.NaN
indicates "no altitude".
-
getLatLon
public LatLonPoint getLatLon()
Description copied from interface:EarthLocation
Get the lat/lon location- Specified by:
getLatLon
in interfaceEarthLocation
- Returns:
- lat/lon location
-
isMissing
public boolean isMissing()
Description copied from interface:EarthLocation
Are either lat or lon missing?- Specified by:
isMissing
in interfaceEarthLocation
- Returns:
- true if lat or lon is missing
-
compareTo
public int compareTo(@Nonnull Station so)
- Specified by:
compareTo
in interfaceComparable<Station>
-
subset
public StationProfileFeature subset(LatLonRect boundingBox)
-
subset
public StationProfileFeature subset(CalendarDateRange dateRange)
Description copied from interface:StationProfileFeature
Subset this collection by dateRange- Specified by:
subset
in interfaceStationProfileFeature
- Parameters:
dateRange
- only points in this date range. may be null.- Returns:
- subsetted collection, may be null if empty
-
iterator
public Iterator<ProfileFeature> iterator()
- Specified by:
iterator
in interfaceIterable<ProfileFeature>
-
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 interfaceStationProfileFeature
- 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 interfaceStationProfileFeature
- 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 interfaceStationProfileFeature
- Throws:
IOException
- on read error
-
-