location
Class Latitude

java.lang.Object
  |
  +--location.Latitude
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class Latitude
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

The latitude value in a physical coordinate system.

Version:
3.0
Author:
Chien-Liang Fok
See Also:
Serialized Form

Field Summary
static int NORTH
           
static int SOUTH
           
 
Constructor Summary
Latitude(double lat)
          Creates a Latitude based on its sexagesimal notation.
Latitude(int degrees, double minutes, int hemisphere)
          Creates a Latitude with the specified degrees, minutes, and direction.
Latitude(Latitude lat)
          The copy constructor.
 
Method Summary
 void changeBy(double delta)
          Changes this latitude by the specifiec amount.
 java.lang.Object clone()
          This method returns a deep copy of this object.
 boolean equals(java.lang.Object o)
          Determines if another object is equal to this one.
 int getDegrees()
          Accessor method to get the degrees latitude
 int getHemisphere()
          Accessor method to get the direction of the latitude
 double getMinutes()
          Accessor method to get the minutes latitude
 double toSexagesimal()
          Returns the sexagesimal notation of this coordinate.
 java.lang.String toString()
          This method returns a string representation of the latitude
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NORTH

public static final int NORTH

SOUTH

public static final int SOUTH
Constructor Detail

Latitude

public Latitude(int degrees,
                double minutes,
                int hemisphere)
Creates a Latitude with the specified degrees, minutes, and direction.
Parameters:
degrees - the degrees latitude
minutes - the minutes latitude
hemisphere - the latitude's hemisphere, either Latitude.NORTH or Latitude.SOUTH.

Latitude

public Latitude(Latitude lat)
The copy constructor.

Latitude

public Latitude(double lat)
Creates a Latitude based on its sexagesimal notation.
Parameters:
lat - the latitude in sexagesimal units
Method Detail

toSexagesimal

public double toSexagesimal()
Returns the sexagesimal notation of this coordinate.
Returns:
the sexagesimal notation of this coordinate.

equals

public boolean equals(java.lang.Object o)
Determines if another object is equal to this one. An object is equal to this one if it is of type Longitude and has the same sexagesimal value.
Overrides:
equals in class java.lang.Object

getDegrees

public int getDegrees()
Accessor method to get the degrees latitude
Returns:
degrees latitude as an int

getMinutes

public double getMinutes()
Accessor method to get the minutes latitude
Returns:
minutes latitude as a double

getHemisphere

public int getHemisphere()
Accessor method to get the direction of the latitude
Returns:
the direction, either Latitude.NORTH or Latitude.SOUTH.

changeBy

public void changeBy(double delta)
Changes this latitude by the specifiec amount.
Parameters:
delta - the amount in sexagesimal units by which to change this Latitude.

toString

public java.lang.String toString()
This method returns a string representation of the latitude
Overrides:
toString in class java.lang.Object
Returns:
string representation of the latitude

clone

public java.lang.Object clone()
This method returns a deep copy of this object.
Overrides:
clone in class java.lang.Object
Returns:
an object