Jeospace API

org.jeospace.measure.angle
Class Longitude

java.lang.Object
  extended byorg.jeospace.measure.angle.DecimalAngle
      extended byorg.jeospace.measure.angle.Longitude
All Implemented Interfaces:
Angle, java.lang.Cloneable, java.lang.Comparable

public class Longitude
extends DecimalAngle
implements java.lang.Cloneable

A subclass of DecimalAngle, a longitude is an angle that is always normalized to a value within a full revolution of arc. The default normalization option is set to AngleNorm.FULL_REVOLUTION. A longitude is typically used as a component of an ellipsoidal or spherical coordinate system.

By convention ( and consistant with SEDRIS and IAU conventions ), longitude directions are measured:

Version:
$Revision: 1.1.1.1 $
Author:
Rex Melton
See Also:
Angle, AngleNorm, DecimalAngle, DecimalAngleUnit, Latitude, SexagesimalAngleType, SexagesimalAngleUnit

Field Summary
static AngleSign EAST
          Constant identifier indicating a positive direction of the Longitude.
protected  AngleNorm norm
          The default normalization option
static AngleSign WEST
          Constant identifier indicating a negative direction of the Longitude.
 
Fields inherited from class org.jeospace.measure.angle.DecimalAngle
angle
 
Constructor Summary
Longitude()
          Construct a Longitude initialized to a value of 0.
Longitude(Angle ang)
          Construct a Longitude initialized to the specified value.
Longitude(DecimalAngleUnit units, double value)
          Construct a Longitude initialized to the value and units specified.
Longitude(SexagesimalAngleType type, AngleSign sign, double unitsValue)
          Construct a Longitude initialized to the value and units specified.
Longitude(SexagesimalAngleType type, AngleSign sign, int unitsValue, double minutes)
          Construct a Longitude initialized to the value and units specified.
Longitude(SexagesimalAngleType type, AngleSign sign, int unitsValue, int minutes, double seconds)
          Construct a Longitude initialized to the value and units specified.
Longitude(SexagesimalAngleType type, AngleSign sign, int unitsValue, int minutes, int seconds, int microseconds)
          Construct a Longitude initialized to the value and units specified.
 
Method Summary
 void add(Angle ang)
          Add to this Longitude the passed Angle.
 void add(DecimalAngleUnit units, double value)
          Add to this Longitude the double value in the specified DecimalAngleUnits.
 void add(SexagesimalAngleUnit units, int value)
          Add to this Longitude the value in the specified SexagesimalAngleUnits.
 java.lang.Object clone()
          Return a copy of this Longitude object.
 boolean equals(java.lang.Object obj)
          Compare two Longitudes for equality.
 void normalize(AngleNorm option)
          Normalize the value of this Longitude as specified by the option field.
 void set(Angle ang)
          Set this Longitude to the specified value.
 void set(DecimalAngleUnit units, double value)
          Set the value of this Longitude to the specified DecimalAngleUnits value.
 void set(SexagesimalAngleType type, AngleSign sign, double unitsValue)
          Set this Longitude to the specified value in the SexagesimalAngleType.
 void set(SexagesimalAngleType type, AngleSign sign, int unitsValue, double minutes)
          Set this Longitude to the specified value in the SexagesimalAngleType.
 void set(SexagesimalAngleType type, AngleSign sign, int unitsValue, int minutes, double seconds)
          Set this Longitude to the specified value in the SexagesimalAngleType.
 void set(SexagesimalAngleType type, AngleSign sign, int unitsValue, int minutes, int seconds, int microseconds)
          Set this Longitude to the specified value in the SexagesimalAngleType.
 void setValueInMicroseconds(SexagesimalAngleType type, long value)
          Set this Longitude to the specified value of microseconds of the SexagesimalAngleType.
 void subtract(Angle ang)
          Subtract from this Longitude the passed Angle.
 
Methods inherited from class org.jeospace.measure.angle.DecimalAngle
changeSign, clear, compareTo, compareTo, get, getSign, getValueInMicroseconds, hashCode, normalizeDegrees, normalizeDegreesNegative, normalizeDegreesPositive, normalizeRadians, normalizeRadiansNegative, normalizeRadiansPositive, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

norm

protected AngleNorm norm
The default normalization option


EAST

public static final AngleSign EAST
Constant identifier indicating a positive direction of the Longitude.


WEST

public static final AngleSign WEST
Constant identifier indicating a negative direction of the Longitude.

Constructor Detail

Longitude

public Longitude()
Construct a Longitude initialized to a value of 0.


Longitude

public Longitude(Angle ang)
Construct a Longitude initialized to the specified value.

Parameters:
ang - the Angle object to duplicate.

Longitude

public Longitude(DecimalAngleUnit units,
                 double value)
Construct a Longitude initialized to the value and units specified.

Parameters:
units - the DecimalAngleUnits of value being input.
value - the input value

Longitude

public Longitude(SexagesimalAngleType type,
                 AngleSign sign,
                 double unitsValue)
Construct a Longitude initialized to the value and units specified.

Parameters:
type - the SexagesimalAngleType.
sign - the AngleSign.
unitsValue - the double value of the primary units of the SexagesimalAngleType.

Longitude

public Longitude(SexagesimalAngleType type,
                 AngleSign sign,
                 int unitsValue,
                 double minutes)
Construct a Longitude initialized to the value and units specified.

Parameters:
type - the SexagesimalAngleType.
sign - the AngleSign.
unitsValue - the integer value of the primary units of the SexagesimalAngleType.
minutes - the double value of the minutes sub-unit of the SexagesimalAngleType.

Longitude

public Longitude(SexagesimalAngleType type,
                 AngleSign sign,
                 int unitsValue,
                 int minutes,
                 double seconds)
Construct a Longitude initialized to the value and units specified.

Parameters:
type - the SexagesimalAngleType.
sign - the AngleSign.
unitsValue - the integer value of the primary units of the SexagesimalAngleType.
minutes - the integer value of the minutes sub-unit of the SexagesimalAngleType.
seconds - the double value of the seconds sub-unit of the SexagesimalAngleType.

Longitude

public Longitude(SexagesimalAngleType type,
                 AngleSign sign,
                 int unitsValue,
                 int minutes,
                 int seconds,
                 int microseconds)
Construct a Longitude initialized to the value and units specified.

Parameters:
type - the SexagesimalAngleType.
sign - the AngleSign.
unitsValue - the integer value of the primary units of the SexagesimalAngleType.
minutes - the integer value of the minutes sub-unit of the SexagesimalAngleType.
seconds - the integer value of the seconds sub-unit of the SexagesimalAngleType.
microseconds - the integer value of the microseconds sub-unit of the SexagesimalAngleType.
Method Detail

set

public void set(Angle ang)
Set this Longitude to the specified value.

Specified by:
set in interface Angle
Overrides:
set in class DecimalAngle
Parameters:
ang - the Angle object to duplicate.

add

public void add(Angle ang)
Add to this Longitude the passed Angle.

Specified by:
add in interface Angle
Overrides:
add in class DecimalAngle
Parameters:
ang - an Angle.

subtract

public void subtract(Angle ang)
Subtract from this Longitude the passed Angle.

Specified by:
subtract in interface Angle
Overrides:
subtract in class DecimalAngle
Parameters:
ang - an Angle.

set

public void set(DecimalAngleUnit units,
                double value)
Set the value of this Longitude to the specified DecimalAngleUnits value.

Specified by:
set in interface Angle
Overrides:
set in class DecimalAngle
Parameters:
units - the DecimalAngleUnits.
value - the double value.

add

public void add(DecimalAngleUnit units,
                double value)
Add to this Longitude the double value in the specified DecimalAngleUnits.

Specified by:
add in interface Angle
Overrides:
add in class DecimalAngle
Parameters:
units - the DecimalAngleUnits.
value - the double value.

set

public void set(SexagesimalAngleType type,
                AngleSign sign,
                double unitsValue)
Set this Longitude to the specified value in the SexagesimalAngleType.

Specified by:
set in interface Angle
Overrides:
set in class DecimalAngle
Parameters:
type - the SexagesimalAngleType.
sign - the AngleSign.
unitsValue - the double value of the primary units of the SexagesimalAngleType.

set

public void set(SexagesimalAngleType type,
                AngleSign sign,
                int unitsValue,
                double minutes)
Set this Longitude to the specified value in the SexagesimalAngleType.

Specified by:
set in interface Angle
Overrides:
set in class DecimalAngle
Parameters:
type - the SexagesimalAngleType.
sign - the AngleSign.
unitsValue - the integer value of the primary units of the SexagesimalAngleType.
minutes - the double value of the minutes sub-unit of the SexagesimalAngleType.

set

public void set(SexagesimalAngleType type,
                AngleSign sign,
                int unitsValue,
                int minutes,
                double seconds)
Set this Longitude to the specified value in the SexagesimalAngleType.

Specified by:
set in interface Angle
Overrides:
set in class DecimalAngle
Parameters:
type - the SexagesimalAngleType.
sign - the AngleSign.
unitsValue - the integer value of the primary units of the SexagesimalAngleType.
minutes - the integer value of the minutes sub-unit of the SexagesimalAngleType.
seconds - the double value of the seconds sub-unit of the SexagesimalAngleType.

set

public void set(SexagesimalAngleType type,
                AngleSign sign,
                int unitsValue,
                int minutes,
                int seconds,
                int microseconds)
Set this Longitude to the specified value in the SexagesimalAngleType.

Specified by:
set in interface Angle
Overrides:
set in class DecimalAngle
Parameters:
type - the SexagesimalAngleType.
sign - the AngleSign.
unitsValue - the integer value of the primary units of the SexagesimalAngleType.
minutes - the integer value of the minutes sub-unit of the SexagesimalAngleType.
seconds - the integer value of the seconds sub-unit of the SexagesimalAngleType.
microseconds - the integer value of the microseconds sub-unit of the SexagesimalAngleType.

setValueInMicroseconds

public void setValueInMicroseconds(SexagesimalAngleType type,
                                   long value)
Set this Longitude to the specified value of microseconds of the SexagesimalAngleType. (i.e. either in microseconds of of degree or microseconds of hour)

Specified by:
setValueInMicroseconds in interface Angle
Overrides:
setValueInMicroseconds in class DecimalAngle
Parameters:
type - the SexagesimalAngleType.
value - the long value in microseconds to set for this Angle.

add

public void add(SexagesimalAngleUnit units,
                int value)
Add to this Longitude the value in the specified SexagesimalAngleUnits.

Specified by:
add in interface Angle
Overrides:
add in class DecimalAngle
Parameters:
units - the SexagesimalAngleUnits.
value - the integer value.

normalize

public void normalize(AngleNorm option)
Normalize the value of this Longitude as specified by the option field. The argument AngleNorm option will become the default normalization.

Specified by:
normalize in interface Angle
Overrides:
normalize in class DecimalAngle
Parameters:
option - the AngleNorm identifier. Values of AngleNorm.NONE or null will be ignored - a longitude must be normalized.

clone

public java.lang.Object clone()
Return a copy of this Longitude object. Overrides Cloneable.

Overrides:
clone in class DecimalAngle
Returns:
a copy of this Longitude object.

equals

public boolean equals(java.lang.Object obj)
Compare two Longitudes for equality. The result is true if and only if the argument object is not null, is a Longitude object and represents an angle of the same magnitude as this Longitude.

Two Longitude objects are equal only if the getAngle method returns the same value for both.

Overrides:
equals in class DecimalAngle
Parameters:
obj - the object to compare with
Returns:
true if the Longitudes are the same; false otherwise.

Jeospace API

Copyright © 2006 - jeospace.org