org.minetti.astrodevice.common.coordinate
Class DecimalCoordinate

java.lang.Object
  extended by org.minetti.astrodevice.common.coordinate.DecimalCoordinate
All Implemented Interfaces:
Serializable, Comparable<Coordinate>, Coordinate

public final class DecimalCoordinate
extends Object
implements Coordinate, Serializable

Immutable object representing a coordinate stored as decimal degrees (DD).

Author:
Jean-Philippe MINETTI
See Also:
Serialized Form

Constructor Summary
DecimalCoordinate(boolean hourAngle, double value)
          Constructor.
 
Method Summary
 int compareTo(Coordinate obj)
           
 boolean equals(Object obj)
           
 int getAngle()
          Returns the angle part of coordinate.
 int getMinutes()
          Returns the minutes part of coordinate.
 double getRadian()
          Returns the full value of the coordinate in radian.
 double getSeconds()
          Returns the seconds part of coordinate.
 double getValue()
          Returns the full value of the coordinate.
 int hashCode()
           
 boolean isHourAngle()
          Returns TRUE if the coordinate is an hour angle and therefore expressed in hours (not in degrees).
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DecimalCoordinate

public DecimalCoordinate(boolean hourAngle,
                         double value)
Constructor.

Parameters:
hourAngle - TRUE if the coordinate is an hour angle and therefore expressed in hours (not in degrees).
value - Full value of the coordinate in hours (h) or degrees (°).
Method Detail

isHourAngle

public boolean isHourAngle()
Description copied from interface: Coordinate
Returns TRUE if the coordinate is an hour angle and therefore expressed in hours (not in degrees).

Specified by:
isHourAngle in interface Coordinate
Returns:
TRUE if the coordinate is expressed in hours (not in degrees).

getRadian

public double getRadian()
Description copied from interface: Coordinate
Returns the full value of the coordinate in radian.

Specified by:
getRadian in interface Coordinate
Returns:
Full value of the coordinate in radian (rad).

getValue

public double getValue()
Description copied from interface: Coordinate
Returns the full value of the coordinate.

Specified by:
getValue in interface Coordinate
Returns:
Full value of the coordinate in hours (h) or degrees (°).

getAngle

public int getAngle()
Description copied from interface: Coordinate
Returns the angle part of coordinate.

Specified by:
getAngle in interface Coordinate
Returns:
Angle part of coordinate in hours (h) or degrees (°).

getMinutes

public int getMinutes()
Description copied from interface: Coordinate
Returns the minutes part of coordinate.

Specified by:
getMinutes in interface Coordinate
Returns:
Minutes part of coordinate (′).

getSeconds

public double getSeconds()
Description copied from interface: Coordinate
Returns the seconds part of coordinate.

Specified by:
getSeconds in interface Coordinate
Returns:
Seconds part of coordinate (″).

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

compareTo

public int compareTo(Coordinate obj)
Specified by:
compareTo in interface Comparable<Coordinate>

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012 astroDevice. All Rights Reserved.