uavsim.datatypes
Class Longitude

java.lang.Object
  extended by uavsim.datatypes.A_LatitudeLongitude<Longitude>
      extended by uavsim.datatypes.Longitude
All Implemented Interfaces:
java.lang.Comparable<Longitude>, I_Unitable<Longitude>

public class Longitude
extends A_LatitudeLongitude<Longitude>

Defines longitude in terms of Universal Transverse Mercator (UTM) coordinates. Only the western hemisphere is currently supported.

Author:
Dan Tappan [16.07.11]

Nested Class Summary
 
Nested classes/interfaces inherited from class uavsim.datatypes.A_LatitudeLongitude
A_LatitudeLongitude.E_Format
 
Field Summary
private static int DEGREES_MODULO
          the degrees in a hemisphere
 
Fields inherited from class uavsim.datatypes.A_LatitudeLongitude
_degrees, _minutes, _seconds, MINUTES_PER_DEGREE, SECONDS_PER_MINUTE
 
Constructor Summary
Longitude(double encoding)
          Creates a longitude object from the decimal encoding format.
Longitude(double encoding, A_LatitudeLongitude.E_Format format)
          Creates a longitude object.
Longitude(int degrees, int minutes, double seconds)
          Creates a longitude object.
 
Method Summary
 Longitude add_(Longitude longitude)
          Adds another unit to this one.
 java.lang.String formatString(boolean isPadded)
          Formats the longitude appropriately.
 Longitude round(Longitude image)
          Rounds the coordinate to the nearest degree, minute, or second.
 Longitude subtract_(Longitude longitude)
          Subtract another unit from this one.
 java.lang.String toString()
          
 
Methods inherited from class uavsim.datatypes.A_LatitudeLongitude
compareTo, formatString, getDecimalEncoding, getDegrees, getMinutes, getMinutesAndSeconds, getSeconds, getSecondsInt, getSecondsTenth, getValue_, round2
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEGREES_MODULO

private static final int DEGREES_MODULO
the degrees in a hemisphere

See Also:
Constant Field Values
Constructor Detail

Longitude

public Longitude(double encoding)
Creates a longitude object from the decimal encoding format.

Parameters:
encoding - - the encoding

Longitude

public Longitude(double encoding,
                 A_LatitudeLongitude.E_Format format)
Creates a longitude object.

Parameters:
encoding - - the encoding
format - - the encoding format

Longitude

public Longitude(int degrees,
                 int minutes,
                 double seconds)
Creates a longitude object.

Parameters:
degrees - - the degrees (western hemisphere only)
minutes - - the minutes
seconds - - the seconds
Method Detail

add_

public Longitude add_(Longitude longitude)
Adds another unit to this one.

Parameters:
longitude - - the unit
Returns:
the result as a new unit

formatString

public java.lang.String formatString(boolean isPadded)
Formats the longitude appropriately. The underscore (_) substitutes for an optional space between the number and hemisphere designator.

Parameters:
isPadded - - whether to pad the format
Returns:
the string

round

public Longitude round(Longitude image)
Rounds the coordinate to the nearest degree, minute, or second. All fields to the right of the selected one become zero.

Specified by:
round in class A_LatitudeLongitude<Longitude>
Parameters:
image - - the image; the one and only one nonzero field specifies the field to round
Returns:
the coordinate

subtract_

public Longitude subtract_(Longitude longitude)
Subtract another unit from this one.

Parameters:
longitude - - the unit
Returns:
the result as a new unit

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object