org.jscience.ml.om.extension.deepsky
Class DeepSkyTargetDS

java.lang.Object
  extended by org.jscience.ml.om.SchemaElement
      extended by org.jscience.ml.om.Target
          extended by org.jscience.ml.om.extension.deepsky.DeepSkyTarget
              extended by org.jscience.ml.om.extension.deepsky.DeepSkyTargetDS
All Implemented Interfaces:
IExtendableSchemaElement, ISchemaElement, ITarget

public class DeepSkyTargetDS
extends DeepSkyTarget

DeepSkyTargetDS extends the org.jscience.ml.om.extension.deepsky.DeepSkyTarget class.
Its specialised for double stars.

Since:
1.0

Field Summary
 
Fields inherited from interface org.jscience.ml.om.ITarget
XML_ELEMENT_ALIASNAME, XML_ELEMENT_CONSTELLATION, XML_ELEMENT_DATASOURCE, XML_ELEMENT_NAME, XML_ELEMENT_TARGET, XML_XSI_TYPE
 
Fields inherited from interface org.jscience.ml.om.ISchemaElement
XML_ELEMENT_ATTRIBUTE_ID
 
Constructor Summary
DeepSkyTargetDS(org.w3c.dom.Node targetElement, IObserver[] observers)
          Constructs a new instance of a DeepSkyTargetDS from a given DOM target Element.
DeepSkyTargetDS(java.lang.String name, IObserver observer)
          Constructs a new instance of a DeepSkyTargetDS.
DeepSkyTargetDS(java.lang.String name, java.lang.String datasource)
          Constructs a new instance of a DeepSkyTargetDS.
 
Method Summary
 org.w3c.dom.Element addToXmlElement(org.w3c.dom.Element element)
          Adds this Target to a given parent XML DOM Element.
 double getCompanionMag()
          Returns the magnitude of the companion star.
 int getPositionAngle()
          Returns the position angle of the double star.
 Angle getSeparation()
          Returns the separation of the double star components.
 java.lang.String getXSIType()
          Returns the XML schema instance type of the implementation.
 void setCompanionMag(double newMagnitude)
          Sets the magnitude of the companion star.
 void setPositionAngle(int newPosAngle)
          Sets the position angle of the double star.
 void setSeparation(Angle newSeparation)
          Sets the separation of the double star components.
 
Methods inherited from class org.jscience.ml.om.extension.deepsky.DeepSkyTarget
createXmlDeepSkyTargetElement, equals, getLargeDiameter, getSmallDiameter, getSurfaceBrightness, getVisibleMagnitude, setLargeDiameter, setSmallDiameter, setSurfaceBrightness, setVisibleMagnitude, toString
 
Methods inherited from class org.jscience.ml.om.Target
addAliasName, addAliasNames, addAsLinkToXmlElement, createXmlTargetElement, getAliasNames, getConstellation, getDatasource, getDisplayName, getName, getObserver, getPosition, removeAliasName, setAliasNames, setConstellation, setDatasource, setName, setObserver, setPosition
 
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
 
Methods inherited from interface org.jscience.ml.om.ISchemaElement
getID
 

Constructor Detail

DeepSkyTargetDS

public DeepSkyTargetDS(org.w3c.dom.Node targetElement,
                       IObserver[] observers)
                throws SchemaException
Constructs a new instance of a DeepSkyTargetDS from a given DOM target Element.
Normally this constructor is called by org.jscience.ml.om.util.SchemaLoader. Please mind that Target has to have a element, or a element. If a element is set, a array with Observers must be passed to check, whether the link is valid.

Parameters:
observers - Array of IObserver that might be linked from this observation, can be NULL if datasource element is set
targetElement - The origin XML DOM Element
Throws:
SchemaException - if given targetElement was null

DeepSkyTargetDS

public DeepSkyTargetDS(java.lang.String name,
                       java.lang.String datasource)
Constructs a new instance of a DeepSkyTargetDS.

Parameters:
name - The name of the double star
datasource - The datasource of the double star

DeepSkyTargetDS

public DeepSkyTargetDS(java.lang.String name,
                       IObserver observer)
Constructs a new instance of a DeepSkyTargetDS.

Parameters:
name - The name of the double star
observer - The observer who is the originator of the double star
Method Detail

addToXmlElement

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

Specified by:
addToXmlElement in interface ITarget
Specified by:
addToXmlElement in class DeepSkyTarget
Parameters:
parent - The parent element for this Target
Returns:
Returns the element given as parameter with this Target as child element.
Might return null if parent was null.
See Also:
Element

getXSIType

public java.lang.String getXSIType()
Returns the XML schema instance type of the implementation.
Example:


Specified by:
getXSIType in interface IExtendableSchemaElement
Specified by:
getXSIType in class DeepSkyTarget
Returns:
The xsi:type value of this implementation

getPositionAngle

public int getPositionAngle()
Returns the position angle of the double star.

Returns:
The position angle of the astronomical object as integer The returned value might be -1 if the value was never set

getSeparation

public Angle getSeparation()
Returns the separation of the double star components.

Returns:
The separation of the double star components as Angle The returned value might be null if the value was never set
See Also:
Angle

getCompanionMag

public double getCompanionMag()
Returns the magnitude of the companion star.

Returns:
The magnitude of the companion star. The returned value might be Double.NaN if the value was never set

setCompanionMag

public void setCompanionMag(double newMagnitude)
Sets the magnitude of the companion star.

Parameters:
newMagnitude - The new magnitude of the companion star.

setPositionAngle

public void setPositionAngle(int newPosAngle)
Sets the position angle of the double star. If the given new position angle is < 0 or > 359 the position angle will be unset again.

Parameters:
newPosAngle - The new position angle of the double star.

setSeparation

public void setSeparation(Angle newSeparation)
Sets the separation of the double star components.
Only positiv angles are allowed.

Parameters:
newSeparation - The new separation of the double star components.
Throws:
java.lang.IllegalArgumentException - If new angle doesn't have a degree value between 0 and 359.9
See Also:
Angle