ucar.unidata.metdata
Class NamedStationImpl

java.lang.Object
  extended by ucar.unidata.metdata.NamedStationImpl
All Implemented Interfaces:
Serializable, Comparable, NamedStation, Station
Direct Known Subclasses:
SoundingStation

public class NamedStationImpl
extends Object
implements NamedStation

A class to hold named location information, for a landmark, city, observation point or station, data point, etc. Name should be unique.

See Also:
Serialized Form

Constructor Summary
NamedStationImpl()
          A no-op ctor for unpersiting this
NamedStationImpl(String name, NamedLocationTuple in_nLT)
          Create a NamedStationImpl from the name and NamedLocation
NamedStationImpl(String id, String name, double latitude, double longitude, double alt, Unit unit)
          Construct an object to hold and transfer settings for a landmark, city, observation point, etc.
NamedStationImpl(String id, String name, List coords, Unit unit)
          _more_
 
Method Summary
 void addProperty(String key, Object value)
          Add an extra property
 int compareTo(NamedStationImpl stn)
          Compare this NamedStationImpl to another NamedStationImpl.
 int compareTo(Object oo)
          Compare this NamedStationImpl to another object
 boolean equals(Object o)
          See if the Object in question is equal to this.
 Real getAltitude()
          Get the altitude as a real (value and unit)
 double getAltitudeAsDouble()
          Return altitude in units of getAltitudeUnit().
 Unit getAltitudeUnit()
          Return Unit of altitude
 List getCoords()
          _more_
 EarthLocation getEarthLocation()
          Create, if needed, and return the location of this station
 String getID()
          Get the station ID.
 String getIdentifier()
          Get the identifier for this NamedLocation.
 double getLatitude()
          Get the latitude.
 double getLongitude()
          Get the longitude.
 String getName()
          Get the station name.
 NamedLocation getNamedLocation()
          Get the NamedLocation for this.
 Hashtable getProperties()
          Get the hashtable of extra properties
 Object getProperty(String key, Object deflt)
          Get an extra property
 void setAltitude(Real v)
          Set the alitude.
 void setID(String v)
          Set the station ID.
 void setLatitude(double v)
          Set the latitude.
 void setLongitude(double v)
          Set the longitude.
 void setName(String v)
          Get the station name.
 void setNamedLocation(NamedLocation v)
          Set the NamedLocation for this.
 void setNamedLocationTuple(NamedLocationTuple v)
          Deprecated.  
 void setProperties(Hashtable v)
          Set the table of extra properties
 String toString()
          Return a String representation of this NamedLocation
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NamedStationImpl

public NamedStationImpl(String id,
                        String name,
                        double latitude,
                        double longitude,
                        double alt,
                        Unit unit)
                 throws VisADException,
                        RemoteException
Construct an object to hold and transfer settings for a landmark, city, observation point, etc.

Parameters:
id - typically a letter or number code
name - some kind of name such as "Kansas City" - should be UNIQUE.
latitude - latitude in decimal geographic degrees
longitude - longitude in decimal geographic degrees
alt - VisAD Real for height above the geoid ("sea level")
unit - VisAD Unit of the altitude
Throws:
RemoteException - Java RMI problem
VisADException - VisAD problem

NamedStationImpl

public NamedStationImpl(String id,
                        String name,
                        List coords,
                        Unit unit)
                 throws VisADException,
                        RemoteException
_more_

Parameters:
id - _more_
name - _more_
coords - _more_
unit - _more_
Throws:
RemoteException - _more_
VisADException - _more_

NamedStationImpl

public NamedStationImpl(String name,
                        NamedLocationTuple in_nLT)
Create a NamedStationImpl from the name and NamedLocation

Parameters:
name - station name
in_nLT - NamedLocation

NamedStationImpl

public NamedStationImpl()
A no-op ctor for unpersiting this

Method Detail

setNamedLocationTuple

public void setNamedLocationTuple(NamedLocationTuple v)
Deprecated. 

Have this method here for backward compatibility with bundles.

Parameters:
v - new NamedLocationTuple

getCoords

public List getCoords()
_more_

Returns:
_more_

getEarthLocation

public EarthLocation getEarthLocation()
                               throws VisADException,
                                      RemoteException
Create, if needed, and return the location of this station

Returns:
location
Throws:
RemoteException - Java RMI problem
VisADException - VisAD problem

getNamedLocation

public NamedLocation getNamedLocation()
Get the NamedLocation for this. Used mostly by XML encoder.

Specified by:
getNamedLocation in interface NamedStation
Returns:
NamedLocation

setNamedLocation

public void setNamedLocation(NamedLocation v)
Set the NamedLocation for this. Used mostly by XML encoder.

Specified by:
setNamedLocation in interface NamedStation
Parameters:
v - the NamedLocation

getLatitude

public double getLatitude()
Get the latitude. Used mostly by XML encoding.

Specified by:
getLatitude in interface NamedStation
Specified by:
getLatitude in interface Station
Returns:
latitude (degrees)

setLatitude

public void setLatitude(double v)
Set the latitude. Used mostly by XML encoding.

Specified by:
setLatitude in interface NamedStation
Parameters:
v - latitude (degrees)

getLongitude

public double getLongitude()
Get the longitude. Used mostly by XML encoding.

Specified by:
getLongitude in interface NamedStation
Specified by:
getLongitude in interface Station
Returns:
longitude (degrees)

setLongitude

public void setLongitude(double v)
Set the longitude. Used mostly by XML encoding.

Specified by:
setLongitude in interface NamedStation
Parameters:
v - longitude (degrees)

getAltitude

public Real getAltitude()
Get the altitude as a real (value and unit)

Specified by:
getAltitude in interface NamedStation
Returns:
altitude

setAltitude

public void setAltitude(Real v)
Set the alitude. Used mostly by XML encoder.

Specified by:
setAltitude in interface NamedStation
Parameters:
v - altitude

getID

public String getID()
Get the station ID. Used mostly by XML encoder.

Specified by:
getID in interface NamedStation
Returns:
the station ID

setID

public void setID(String v)
Set the station ID. Used mostly by XML encoder.

Specified by:
setID in interface NamedStation
Parameters:
v - the station ID

getName

public String getName()
Get the station name. Used mostly by XML encoder.

Specified by:
getName in interface NamedStation
Returns:
the station name

setName

public void setName(String v)
Get the station name. Used mostly by XML encoder.

Specified by:
setName in interface NamedStation
Parameters:
v - the station name

equals

public boolean equals(Object o)
See if the Object in question is equal to this.

Specified by:
equals in interface NamedStation
Overrides:
equals in class Object
Parameters:
o - Object in question
Returns:
true if they are equal

getIdentifier

public String getIdentifier()
Get the identifier for this NamedLocation. It can either be the station ID, or the name if ID is null

Specified by:
getIdentifier in interface Station
Returns:
identifier for this station

getAltitudeAsDouble

public double getAltitudeAsDouble()
Return altitude in units of getAltitudeUnit().

Returns:
altitude value

getAltitudeUnit

public Unit getAltitudeUnit()
Return Unit of altitude

Returns:
altitude Unit

getProperties

public Hashtable getProperties()
Get the hashtable of extra properties

Returns:
extra properties

setProperties

public void setProperties(Hashtable v)
Set the table of extra properties

Parameters:
v - extra properties

addProperty

public void addProperty(String key,
                        Object value)
Add an extra property

Parameters:
key - property name
value - property value

getProperty

public Object getProperty(String key,
                          Object deflt)
Get an extra property

Parameters:
key - property name
deflt - default value if property doesn't exist

toString

public String toString()
Return a String representation of this NamedLocation

Overrides:
toString in class Object
Returns:
a String representation

compareTo

public int compareTo(NamedStationImpl stn)
Compare this NamedStationImpl to another NamedStationImpl. Comparison is on the unique identifying name.

Parameters:
stn - other NamedStationImpl to compare
Returns:
comparative value
See Also:
Comparable

compareTo

public int compareTo(Object oo)
Compare this NamedStationImpl to another object

Specified by:
compareTo in interface Comparable
Parameters:
oo - other object to compare
Returns:
comparative value