location
Class Latitude

java.lang.Object
  extended bylocation.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
private  double lat
          This is the latitude in sexagesimal units.
(package private) static double MAX_LAT
           
(package private) static double MIN_LAT
           
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
See Also:
Constant Field Values

SOUTH

public static final int SOUTH
See Also:
Constant Field Values

MAX_LAT

static final double MAX_LAT
See Also:
Constant Field Values

MIN_LAT

static final double MIN_LAT
See Also:
Constant Field Values

lat

private double lat
This is the latitude in sexagesimal units.

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.


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

Returns:
string representation of the latitude

clone

public java.lang.Object clone()
This method returns a deep copy of this object.

Returns:
an object