| java.lang.Object org.cougaar.tools.csmart.util.NamedLocationImpl
NamedLocationImpl | public class NamedLocationImpl implements NewNamedLocation(Code) | | A location (as a LatLonPoint ) with a name.
Multiple constructors are available.
Utility functions to find the distance from this location to another
See Also: NewNamedLocation See Also: LatLonPoint |
Constructor Summary | |
public | NamedLocationImpl() | public | NamedLocationImpl(String name) Creates a new NamedLocationImpl instance.
This constructor will try to parse the String to find
a name, lat, and long (float degrees). | public | NamedLocationImpl(LatLonPoint pos) Creates a new NamedLocationImpl instance. | public | NamedLocationImpl(String name, LatLonPoint pos) Creates a new NamedLocationImpl instance. | public | NamedLocationImpl(String name, float lat, float lon) Creates a new NamedLocationImpl instance. | public | NamedLocationImpl(String name, float lat, float lon, boolean isRadian) Creates a new NamedLocationImpl instance. | public | NamedLocationImpl(NamedLocation pt) Creates a new NamedLocationImpl instance. | public | NamedLocationImpl(String name, double lat, double lon) Creates a new NamedLocationImpl instance. |
NamedLocationImpl | public NamedLocationImpl()(Code) | | |
NamedLocationImpl | public NamedLocationImpl(String name)(Code) | | Creates a new NamedLocationImpl instance.
This constructor will try to parse the String to find
a name, lat, and long (float degrees). If it cant, it treats the String
as a Name.
The 3 fields are expected to be separated with a vertical bar (|).
If there are errors parsing the lat & long, the default is 0.0 for each.
Parameters: name - a String location name or composite location, lat, long |
NamedLocationImpl | public NamedLocationImpl(LatLonPoint pos)(Code) | | Creates a new NamedLocationImpl instance.
Parameters: pos - a LatLonPoint position |
NamedLocationImpl | public NamedLocationImpl(String name, LatLonPoint pos)(Code) | | Creates a new NamedLocationImpl instance.
Parameters: name - a String name Parameters: pos - a LatLonPoint |
NamedLocationImpl | public NamedLocationImpl(String name, float lat, float lon)(Code) | | Creates a new NamedLocationImpl instance.
Parameters: name - a String name Parameters: lat - a float latitude in degrees Parameters: lon - a float longitude in degrees |
NamedLocationImpl | public NamedLocationImpl(String name, float lat, float lon, boolean isRadian)(Code) | | Creates a new NamedLocationImpl instance.
Parameters: name - a String location name Parameters: lat - a float latitude in radians Parameters: lon - a float longitdue in radians Parameters: isRadian - a boolean that should be true and is always ignored |
NamedLocationImpl | public NamedLocationImpl(NamedLocation pt)(Code) | | Creates a new NamedLocationImpl instance.
Parameters: pt - a NamedLocation to copy |
NamedLocationImpl | public NamedLocationImpl(String name, double lat, double lon)(Code) | | Creates a new NamedLocationImpl instance.
Parameters: name - a String name Parameters: lat - a double latitude in degrees Parameters: lon - a double longitude in degrees |
distanceFrom | public double distanceFrom(LatLonPoint other)(Code) | | Get the distance in kilometers from this point to the given point
Parameters: other - a LatLonPoint to find the distance to a double distance in kilometers |
distanceFrom | public double distanceFrom(NamedLocation other)(Code) | | Get the distance in kilometers from this point to the given point
Parameters: other - a NamedLocation value a double distance in kilometers |
distanceFrom | public float distanceFrom(double lat, double lon)(Code) | | Get the distance in kilometers from this point to the given point
Parameters: lat - a double latitude in degrees Parameters: lon - a double longitude in degrees a float distance in kilometers |
distanceFrom | public float distanceFrom(float lat, float lon)(Code) | | Get the distance in kilometers from this point to the given point
Parameters: lat - a float latitude in degrees Parameters: lon - a float longitude in degrees a float distance in kilometers |
equals | public boolean equals(Object obj)(Code) | | 2 NamedLocationImpl s are equals if they have the same name
The position is ignored for this purpose.
Parameters: obj - an Object to compare a boolean |
getName | public String getName()(Code) | | Get the name of this location, possibly null
a String location name, possibly null |
getPosition | public LatLonPoint getPosition()(Code) | | Get the position of this location
a LatLonPoint |
setName | public void setName(String name)(Code) | | Set the name of this location, overriding any previous name
Parameters: name - a String location name |
setPosition | public void setPosition(LatLonPoint pos)(Code) | | Set the position of this location
Parameters: pos - a LatLonPoint |
|
|