uavsim.datatypes
Class Latitude

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

public class Latitude
extends A_LatitudeLongitude<Latitude>

Defines latitude in terms of Universal Transverse Mercator (UTM) coordinates. Only the northern 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
Latitude(double encoding)
          Creates a latitude object from the decimal encoding format.
Latitude(double encoding, A_LatitudeLongitude.E_Format format)
          Creates a latitude object.
Latitude(int degrees, int minutes, double seconds)
          Creates a latitude object.
 
Method Summary
 Latitude add_(Latitude latitude)
          Adds another unit to this one.
 java.lang.String formatString(boolean isPadded)
          Formats the latitude appropriately.
 Latitude round(Latitude image)
          Rounds the coordinate to the nearest degree, minute, or second.
 Latitude subtract_(Latitude latitude)
          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

Latitude

public Latitude(double encoding)
Creates a latitude object from the decimal encoding format.

Parameters:
encoding - - the encoding

Latitude

public Latitude(double encoding,
                A_LatitudeLongitude.E_Format format)
Creates a latitude object.

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

Latitude

public Latitude(int degrees,
                int minutes,
                double seconds)
Creates a latitude object.

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

add_

public Latitude add_(Latitude latitude)
Adds another unit to this one.

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

formatString

public java.lang.String formatString(boolean isPadded)
Formats the latitude 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 Latitude round(Latitude 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<Latitude>
Parameters:
image - - the image; the one and only one nonzero field specifies the field to round
Returns:
the coordinate

subtract_

public Latitude subtract_(Latitude latitude)
Subtract another unit from this one.

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

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object