javax.microedition.location
Class Coordinates

java.lang.Object
  extended byjavax.microedition.location.Coordinates
Direct Known Subclasses:
QualifiedCoordinates

public class Coordinates
extends Object

The Coordinates class represents coordinates as latitude-longitude-altitude values. The latitude and longitude values are expressed in degrees using floating point values. The degrees are in decimal values (rather than minutes/seconds). The coordinates are given using the WGS84 datum. This class is extracted from JSR179

Version:
0.1, 26 march 2003
Author:
donsez

Field Summary
protected  float altitude
           
static int DD_MM
          Identifier for string coordinate representation Degrees, Minutes, decimal fractions of a minute
static int DD_MM_SS
          Identifier for string coordinate representation Degrees, Minutes, Seconds and decimal fractions of a second
protected  float latitude
           
protected  float longitude
           
 
Constructor Summary
Coordinates()
          Constructs a new Coordinates object with the values specified.
Coordinates(float latitude, float longitude, float altitude)
          Constructs a new Coordinates object with the values specified.
 
Method Summary
 float bearing(Coordinates to)
          Calculates the great circle bearing between the two points.
static String convert(float coordinate, int outputType)
          Converts a float representation of a coordinate with decimal degrees into a string representation
static float convert(String coordinate, int inputType)
          Converts a String representation of a coordinate into the float representation as used in this API.
 float distance(Coordinates to)
          Calculates the great circle distance between the two points.
 float getAltitude()
          Returns the altitude component of this coordinate.
 float getLatitude()
          Returns the latitude component of this coordinate.
 float getLongitude()
          Returns the longitude component of this coordinate.
 void setAltitude(float altitude)
          Sets the geodetic altitude for this point.
 void setLatitude(float latitude)
          Sets the geodetic latitude for this point.
 void setLongitude(float longitude)
          Sets the geodetic longitude for this point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

latitude

protected float latitude

longitude

protected float longitude

altitude

protected float altitude

DD_MM

public static final int DD_MM
Identifier for string coordinate representation Degrees, Minutes, decimal fractions of a minute

See Also:
Constant Field Values

DD_MM_SS

public static final int DD_MM_SS
Identifier for string coordinate representation Degrees, Minutes, Seconds and decimal fractions of a second

See Also:
Constant Field Values
Constructor Detail

Coordinates

public Coordinates()
Constructs a new Coordinates object with the values specified.


Coordinates

public Coordinates(float latitude,
                   float longitude,
                   float altitude)
Constructs a new Coordinates object with the values specified.

Parameters:
latitude - Description of the Parameter
longitude - Description of the Parameter
altitude - Description of the Parameter
Method Detail

bearing

public float bearing(Coordinates to)
Calculates the great circle bearing between the two points.

Parameters:
to - Description of the Parameter
Returns:
Description of the Return Value

convert

public static float convert(String coordinate,
                            int inputType)
Converts a String representation of a coordinate into the float representation as used in this API.

Parameters:
coordinate - Description of the Parameter
inputType - Description of the Parameter
Returns:
Description of the Return Value

distance

public float distance(Coordinates to)
Calculates the great circle distance between the two points.

Parameters:
to - Description of the Parameter
Returns:
Description of the Return Value

convert

public static String convert(float coordinate,
                             int outputType)
Converts a float representation of a coordinate with decimal degrees into a string representation

Parameters:
coordinate - Description of the Parameter
outputType - Description of the Parameter
Returns:
Description of the Return Value

getAltitude

public float getAltitude()
Returns the altitude component of this coordinate.

Returns:
The altitude value

getLatitude

public float getLatitude()
Returns the latitude component of this coordinate.

Returns:
The latitude value

getLongitude

public float getLongitude()
Returns the longitude component of this coordinate.

Returns:
The longitude value

setAltitude

public void setAltitude(float altitude)
Sets the geodetic altitude for this point.

Parameters:
altitude - The new altitude value

setLatitude

public void setLatitude(float latitude)
Sets the geodetic latitude for this point.

Parameters:
latitude - The new latitude value

setLongitude

public void setLongitude(float longitude)
Sets the geodetic longitude for this point.

Parameters:
longitude - The new longitude value