location
Class Longitude

java.lang.Object
  extended bylocation.Longitude
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

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

The longitude value in a physical coordinate system.

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

Field Summary
static int EAST
           
private  double log
          This is the Longitude in sexagesimal units.
(package private) static double MAX_LOG
           
(package private) static double MIN_LOG
           
static int WEST
           
 
Constructor Summary
Longitude(double log)
          Creates a Longitude based on its sexagesimal notation.
Longitude(int degrees, double minutes, int hemisphere)
          Creates a Longitude with the specified degrees, minutes, and direction.
Longitude(Longitude log)
          The copy constructor.
 
Method Summary
 void changeBy(double delta)
          Changes this Longitude 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 Longitude
 int getHemisphere()
          Accessor method to get the direction of the Longitude
 double getMinutes()
          Accessor method to get the minutes Longitude
 double toSexagesimal()
          Returns the sexagesimal notation of this Longitude.
 java.lang.String toString()
          This method returns a string representation of this Longitude.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EAST

public static final int EAST
See Also:
Constant Field Values

WEST

public static final int WEST
See Also:
Constant Field Values

MAX_LOG

static final double MAX_LOG
See Also:
Constant Field Values

MIN_LOG

static final double MIN_LOG
See Also:
Constant Field Values

log

private double log
This is the Longitude in sexagesimal units.

Constructor Detail

Longitude

public Longitude(int degrees,
                 double minutes,
                 int hemisphere)
Creates a Longitude with the specified degrees, minutes, and direction.

Parameters:
degrees - the degrees Longitude
minutes - the minutes Longitude
hemisphere - the Longitude's hemisphere, either Longitude.EAST or Longitude.WEST.

Longitude

public Longitude(Longitude log)
The copy constructor.


Longitude

public Longitude(double log)
Creates a Longitude based on its sexagesimal notation.

Parameters:
log - the longitude in sexagesimal units
Method Detail

toSexagesimal

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

Returns:
the sexagesimal notation of this Longitude.

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 Longitude

Returns:
degrees Longitude

getMinutes

public double getMinutes()
Accessor method to get the minutes Longitude

Returns:
minutes Longitude as a double

getHemisphere

public int getHemisphere()
Accessor method to get the direction of the Longitude

Returns:
the direction, either Longitude.EAST or Longitude.WEST.

changeBy

public void changeBy(double delta)
Changes this Longitude by the specifiec amount.

Parameters:
delta - the amount in sexagesimal units by which to change this Longitude.

toString

public java.lang.String toString()
This method returns a string representation of this Longitude.

Returns:
string representation of the Longitude.

clone

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

Returns:
an object