org.jscience.ml.om
Class EquPosition

java.lang.Object
  extended by org.jscience.ml.om.SchemaElement
      extended by org.jscience.ml.om.EquPosition
All Implemented Interfaces:
ISchemaElement

public class EquPosition
extends SchemaElement

EquPosition provides a representation of a equatorial celestial position.
A equatorial position is given with three values. The right ascension and the declination are used to define the celestial position while both values are valid within a special reference time frame (the third value).

Since:
1.0

Field Summary
static java.lang.String DEC_DEG
          DOCUMENT ME!
static java.lang.String DEC_MIN
          DOCUMENT ME!
static java.lang.String DEC_SEC
          DOCUMENT ME!
static java.lang.String RA_HOUR
          DOCUMENT ME!
static java.lang.String RA_MIN
          DOCUMENT ME!
static java.lang.String RA_SEC
          DOCUMENT ME!
static java.lang.String XML_ELEMENT_DEC
          DOCUMENT ME!
static java.lang.String XML_ELEMENT_POSITION
          DOCUMENT ME!
static java.lang.String XML_ELEMENT_RA
          DOCUMENT ME!
 
Fields inherited from interface org.jscience.ml.om.ISchemaElement
XML_ELEMENT_ATTRIBUTE_ID
 
Constructor Summary
EquPosition(Angle ra, Angle dec)
           
EquPosition(org.w3c.dom.Node positionNode)
          Constructs a new instance of a EquPosition from a given DOM target Element.
EquPosition(java.lang.String ra, java.lang.String dec)
           
 
Method Summary
 org.w3c.dom.Element addToXmlElement(org.w3c.dom.Element parent)
          Adds this EquPosition to an given parent XML DOM Element.
 boolean equals(java.lang.Object obj)
          Overwrittes equals(Object) method from java.lang.Object.
 java.lang.String getDec()
          Returns the declination of this equatorial position..
 Angle getDecAngle()
          Returns the declination of this equatorial position as Angle.
static java.lang.String getDecString(int deg, int min, int sec)
          Returns a correct formed declination string.
 java.lang.String getDisplayName()
          Returns a display name for this element.
 EquPositionReferenceFrame getFrame()
          Returns the position reference frame of this equatorial position.
 java.lang.String getRa()
          Returns the right ascension of this equatorial position.
 Angle getRaAngle()
          Returns the right ascension of this equatorial position as Angle.
static java.lang.String getRaString(int hours, int min, int sec)
          Returns a correct formed right ascension string.
 void setDec(java.lang.String dec)
          Sets the declination of the equatorial position.
 void setDecAngle(Angle dec)
          Sets the declination of the equatorial position.
 void setFrame(EquPositionReferenceFrame frame)
          Sets the position reference frame of this equatorial position.
 void setRa(java.lang.String ra)
          Sets the right ascension of this equatorial position.
 void setRaAngle(Angle ra)
          Sets the right ascension of this equatorial position.
 java.lang.String toString()
          Overwrittes toString() method from java.lang.Object.
 
Methods inherited from class org.jscience.ml.om.SchemaElement
getID, setID
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

XML_ELEMENT_POSITION

public static final java.lang.String XML_ELEMENT_POSITION
DOCUMENT ME!

See Also:
Constant Field Values

XML_ELEMENT_RA

public static final java.lang.String XML_ELEMENT_RA
DOCUMENT ME!

See Also:
Constant Field Values

XML_ELEMENT_DEC

public static final java.lang.String XML_ELEMENT_DEC
DOCUMENT ME!

See Also:
Constant Field Values

RA_HOUR

public static final java.lang.String RA_HOUR
DOCUMENT ME!

See Also:
Constant Field Values

RA_MIN

public static final java.lang.String RA_MIN
DOCUMENT ME!

See Also:
Constant Field Values

RA_SEC

public static final java.lang.String RA_SEC
DOCUMENT ME!

See Also:
Constant Field Values

DEC_DEG

public static final java.lang.String DEC_DEG
DOCUMENT ME!

See Also:
Constant Field Values

DEC_MIN

public static final java.lang.String DEC_MIN
DOCUMENT ME!

See Also:
Constant Field Values

DEC_SEC

public static final java.lang.String DEC_SEC
DOCUMENT ME!

See Also:
Constant Field Values
Constructor Detail

EquPosition

public EquPosition(org.w3c.dom.Node positionNode)
            throws SchemaException
Constructs a new instance of a EquPosition from a given DOM target Element.

Parameters:
positionNode - The origin XML DOM position Element
Throws:
SchemaException - if given positionNode was null

EquPosition

public EquPosition(Angle ra,
                   Angle dec)
            throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

EquPosition

public EquPosition(java.lang.String ra,
                   java.lang.String dec)
            throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException
Method Detail

getDisplayName

public java.lang.String getDisplayName()
Returns a display name for this element.
The method differs from the toString() method as toString() shows more technical information about the element. Also the formating of toString() can spread over several lines.
This method returns a string (in one line) that can be used as displayname in e.g. a UI dropdown box.

Specified by:
getDisplayName in interface ISchemaElement
Specified by:
getDisplayName in class SchemaElement
Returns:
Returns a String with a one line display name
See Also:
java.lang.Object.toString();

toString

public java.lang.String toString()
Overwrittes toString() method from java.lang.Object.
Returns the equatorial position as string in form:
Example:
Right ascension: 4.159876545 RAD
* Declination: -0.258774154 RAD Reference frame: Topocentric J2000.0

Overrides:
toString in class java.lang.Object
Returns:
A string representing the equatorial position
See Also:
Object

equals

public boolean equals(java.lang.Object obj)
Overwrittes equals(Object) method from java.lang.Object.
Checks if this EquPosition and the given Object are equal. The given object is equal with this EquPosition, if the right ascension, declination and the position reference frame are equal.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The Object to compare this EquPosition with.
Returns:
true if the given Object is an instance of EquPosition and its right ascension, declination and position reference frame are equal with this EquPosition.
*
See Also:
Object

getRaString

public static java.lang.String getRaString(int hours,
                                           int min,
                                           int sec)
Returns a correct formed right ascension string.

Parameters:
hours - Hour value
min - Minute value
sec - Second value
Returns:
The right ascension as correct formated sting.

getDecString

public static java.lang.String getDecString(int deg,
                                            int min,
                                            int sec)
Returns a correct formed declination string.

Parameters:
deg - Degree value
min - Minute value
sec - Second value
Returns:
The declination as correct formated sting.

addToXmlElement

public org.w3c.dom.Element addToXmlElement(org.w3c.dom.Element parent)
Adds this EquPosition to an given parent XML DOM Element. The EquPosition Element will be set as a child element of the passed Element.

Parameters:
parent - The parent element for this EquPosition
Returns:
Returns the Element given as parameter with this EquPosition as child Element.
* Might return null if parent was null.
See Also:
Element

getDecAngle

public Angle getDecAngle()
Returns the declination of this equatorial position as Angle. This might have a strange unit for Dec values.

Returns:
The declination as instance of class Angle

getDec

public java.lang.String getDec()
Returns the declination of this equatorial position..

Returns:
The declination as displayable value

getRaAngle

public Angle getRaAngle()
Returns the right ascension of this equatorial position as Angle. This might have a strange unit for RA values. Maybe getRa() is what you want.

Returns:
The right ascension as instance of class Angle

getRa

public java.lang.String getRa()
Returns the right ascension of this equatorial position.

Returns:
The right ascension as displayable sting.

setDec

public void setDec(java.lang.String dec)
            throws java.lang.IllegalArgumentException
Sets the declination of the equatorial position. Input string must be of format 0102'03''.

Parameters:
dec - The new declination of the equatorial position
Throws:
java.lang.IllegalArgumentException - if dec was null or the string was malformed

setRa

public void setRa(java.lang.String ra)
           throws java.lang.IllegalArgumentException
Sets the right ascension of this equatorial position. Input sting must be of format 01h02min03sec

Parameters:
ra - The right ascension of the equatorial position
Throws:
java.lang.IllegalArgumentException - if ra is null or the string was malformed

setDecAngle

public void setDecAngle(Angle dec)
                 throws java.lang.IllegalArgumentException
Sets the declination of the equatorial position.

Parameters:
dec - The new declination of the equatorial position
Throws:
java.lang.IllegalArgumentException - if dec was null

setRaAngle

public void setRaAngle(Angle ra)
                throws java.lang.IllegalArgumentException
Sets the right ascension of this equatorial position. The Angles value has to be positive.

Parameters:
ra - The right ascension of the equatorial position
Throws:
java.lang.IllegalArgumentException - if ra is null or ra value is negative

getFrame

public EquPositionReferenceFrame getFrame()
Returns the position reference frame of this equatorial position.

Returns:
The position reference frame of this equatorial position

setFrame

public void setFrame(EquPositionReferenceFrame frame)
Sets the position reference frame of this equatorial position.
If null is passed the new position reference frame that is set is geocentric with equinox J2000.0

Parameters:
frame - The new position reference frame