org.jscience.ml.om.extension.solarsystem
Class SolarSystemTarget

java.lang.Object
  extended by org.jscience.ml.om.SchemaElement
      extended by org.jscience.ml.om.Target
          extended by org.jscience.ml.om.extension.solarsystem.SolarSystemTarget
All Implemented Interfaces:
IExtendableSchemaElement, ISchemaElement, ITarget
Direct Known Subclasses:
SolarSystemTargetComet, SolarSystemTargetMinorPlanet, SolarSystemTargetMoon, SolarSystemTargetPlanet, SolarSystemTargetSun

public abstract class SolarSystemTarget
extends Target

SolarSystemTarget extends the org.jscience.ml.om.Target class. Its specialised for solar system targets. A SolarSystemTarget target can be any astronomical object inside our solar system.
This class exists more due to extension reasons as this class does not add new functions to org.jscience.ml.om.Target

Since:
1.3

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 SolarSystemTarget(org.w3c.dom.Node targetElement, IObserver[] observers)
          Constructs a new instance of a SolarSystemTarget from a given DOM target Element.
protected SolarSystemTarget(java.lang.String name, IObserver observer)
          Constructs a new instance of a SolarSystemTarget.
protected SolarSystemTarget(java.lang.String name, java.lang.String datasource)
          Constructs a new instance of a SolarSystemTarget.
 
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 createXmlSolarSystemTargetElement(org.w3c.dom.Element element, java.lang.String xsiType)
          Creates a SolarSystemTarget under the target container.
 boolean equals(java.lang.Object obj)
          Overwrittes equals(Object) method from java.lang.Object.
abstract  java.lang.String getXSIType()
          Returns the XML schema instance type of the implementation.
 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

SolarSystemTarget

protected SolarSystemTarget(org.w3c.dom.Node targetElement,
                            IObserver[] observers)
                     throws SchemaException
Constructs a new instance of a SolarSystemTarget 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

SolarSystemTarget

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

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

SolarSystemTarget

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

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 SolarSystemTarget.

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

equals

public boolean equals(java.lang.Object obj)
Overwrittes equals(Object) method from java.lang.Object.
Checks if this SolarSystemTarget 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 SolarSystemTarget name.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The Object to compare this SolarSystemTarget with.
Returns:
true if the given Object is an instance of ITarget, both XSI types are equal and its name is equal to this SolarSystemTarget 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

createXmlSolarSystemTargetElement

protected org.w3c.dom.Element createXmlSolarSystemTargetElement(org.w3c.dom.Element element,
                                                                java.lang.String xsiType)
Creates a SolarSystemTarget 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 SolarSystemTarget. 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