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

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
All Implemented Interfaces:
IExtendableSchemaElement, ISchemaElement, ITarget
Direct Known Subclasses:
DeepSkyTargetDN, DeepSkyTargetDS, DeepSkyTargetGC, DeepSkyTargetGN, DeepSkyTargetGX, DeepSkyTargetNA, DeepSkyTargetOC, DeepSkyTargetPN, DeepSkyTargetQS

public abstract class DeepSkyTarget
extends Target

DeepSkyTarget extends the org.jscience.ml.om.Target class. Its specialised for DeepSky targets. A DeepSky target can be an astronomical object outside our solar system.
Mostly all fields of the class are optional, only the name (which is derived from class Target) is madatory.

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
protected DeepSkyTarget(org.w3c.dom.Node targetElement, IObserver[] observers)
          Constructs a new instance of a DeepSkyTarget from a given DOM target Element.
protected DeepSkyTarget(java.lang.String name, IObserver observer)
          Constructs a new instance of a DeepSkyTarget.
protected DeepSkyTarget(java.lang.String name, java.lang.String datasource)
          Constructs a new instance of a DeepSkyTarget.
 
Method Summary
abstract  org.w3c.dom.Element addToXmlElement(org.w3c.dom.Element element)
          Adds this Target to a given parent XML DOM Element.
protected  org.w3c.dom.Element createXmlDeepSkyTargetElement(org.w3c.dom.Element element, java.lang.String xsiType)
          Creates a deepkSkyTarget under the target container.
 boolean equals(java.lang.Object obj)
          Overwrittes equals(Object) method from java.lang.Object.
 Angle getLargeDiameter()
          Returns the large diameter of the astronomical object.
 Angle getSmallDiameter()
          Returns the small diameter of the astronomical object.
 float getSurfaceBrightness()
          Returns the surface brightness of the astronomical object in magnitudes per squareminute.
 float getVisibleMagnitude()
          Returns the visible magnitude of the astronomical object.
abstract  java.lang.String getXSIType()
          Returns the XML schema instance type of the implementation.
 boolean setLargeDiameter(Angle largeDiameter)
          Sets the large diameter of the DeepSkyTarget.
 boolean setSmallDiameter(Angle smallDiameter)
          Sets the small diameter of the DeepSkyTarget.
 void setSurfaceBrightness(float surfaceBrightness)
          Sets the surface brightness of the astronomical object.
 void setVisibleMagnitude(float visibleMagnitude)
          Sets the visible magnitude of the astronomical object.
 java.lang.String toString()
          Overwrittes toString() method from java.lang.Object.
 
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

DeepSkyTarget

protected DeepSkyTarget(org.w3c.dom.Node targetElement,
                        IObserver[] observers)
                 throws SchemaException
Constructs a new instance of a DeepSkyTarget from a given DOM target Element.
Normally this constructor is called by a subclass which itself 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

DeepSkyTarget

protected DeepSkyTarget(java.lang.String name,
                        java.lang.String datasource)
Constructs a new instance of a DeepSkyTarget.

Parameters:
name - The name of the astronomical object
datasource - The datasource of the astronomical object

DeepSkyTarget

protected DeepSkyTarget(java.lang.String name,
                        IObserver observer)
Constructs a new instance of a DeepSkyTarget.

Parameters:
name - The name of the astronomical object
observer - The observer who is the originator of the target
Method Detail

toString

public java.lang.String toString()
Overwrittes toString() method from java.lang.Object.
Returns the field values of this DeepSkyTarget.

Overrides:
toString in class java.lang.Object
Returns:
This DeepSkyTarget field values
See Also:
Object

equals

public boolean equals(java.lang.Object obj)
Overwrittes equals(Object) method from java.lang.Object.
Checks if this DeepSkyTarget and the given Object are equal. The given object is equal with this DeepSkyTarget, if it derives from ITarget, both XSI types are equal and its name equals this DeepSkyTargets name.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The Object to compare this DeepSkyTarget with.
Returns:
true if the given Object is an instance of ITarget, both XSI types are equal and its name is equal to this DeepSkyTargets name.
(Name comparism is not casesensitive)
See Also:
Object

getXSIType

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


Returns:
The xsi:type value of this implementation

addToXmlElement

public abstract 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 Target
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

createXmlDeepSkyTargetElement

protected org.w3c.dom.Element createXmlDeepSkyTargetElement(org.w3c.dom.Element element,
                                                            java.lang.String xsiType)
Creates a deepkSkyTarget under the target container. If no target container exists under the given elements ownerDocument, it will be created.
This method should be called by subclasses, so that they only have to add their specific data to the element returned. Example:
<parameterElement>
<targetLink>123</targetLink>
</parameterElement>
More stuff of the xml document goes here
<targetContainer>
<target id="123">
target description goes here
</target>
</targetContainer>

Parameters:
element - The element under which the the target link is created
xsiType - The XSI:Type identification of the child class
Returns:
Returns a new created target Element that contains all data from a DeepSkyTarget. Please mind, NOT the passed element is given, but a child element of the passed elements ownerDocument. Might return null if element was null.
See Also:
Element

getLargeDiameter

public Angle getLargeDiameter()
Returns the large diameter of the astronomical object.

Returns:
The large diameter of the astronomical object as Angle The returned value might be null if the value was never set
See Also:
Angle

getSmallDiameter

public Angle getSmallDiameter()
Returns the small diameter of the astronomical object.

Returns:
The small diameter of the astronomical object as Angle The returned value might be null if the value was never set
See Also:
Angle

getSurfaceBrightness

public float getSurfaceBrightness()
Returns the surface brightness of the astronomical object in magnitudes per squareminute.

Returns:
The surface brightness of the astronomical object.
Might return Float.NaN if surface brightness was never set

getVisibleMagnitude

public float getVisibleMagnitude()
Returns the visible magnitude of the astronomical object.

Returns:
The visible magnitude of the astronomical object.
Might return Float.NaN if visible magnitude was never set

setLargeDiameter

public boolean setLargeDiameter(Angle largeDiameter)
Sets the large diameter of the DeepSkyTarget. A valid Angle has a value larger (or euqals) 0.0.

Parameters:
largeDiameter - The large diameter to set
Returns:
boolean true if the large diameter could be set. If false is returned the parameter was null or had a negative value.

setSmallDiameter

public boolean setSmallDiameter(Angle smallDiameter)
Sets the small diameter of the DeepSkyTarget. A valid Angle has a value larger (or euqals) 0.0.

Parameters:
smallDiameter - The small diameter to set
Returns:
boolean true if the small diameter could be set. If false is returned the parameter was null or had a negative value.

setSurfaceBrightness

public void setSurfaceBrightness(float surfaceBrightness)
Sets the surface brightness of the astronomical object.
The value should be given as magnitudes per squareminute.

Parameters:
surfaceBrightness - The surface brightness to set

setVisibleMagnitude

public void setVisibleMagnitude(float visibleMagnitude)
Sets the visible magnitude of the astronomical object.

Parameters:
visibleMagnitude - The visible magnitude to set