org.jscience.ml.om
Class Finding

java.lang.Object
  extended by org.jscience.ml.om.SchemaElement
      extended by org.jscience.ml.om.Finding
All Implemented Interfaces:
IExtendableSchemaElement, IFinding, ISchemaElement
Direct Known Subclasses:
DeepSkyFinding, GenericFinding

public abstract class Finding
extends SchemaElement
implements IFinding

The abstract class Finding provides some common features that may be used by the subclasses of an org.jscience.ml.om.IFinding.
The Finding class stores a description of the findings and provides simple access to this description field. It also implements a basic XML DOM helper method that may be used by all subclasses that have to implement the IFinding interface.

Since:
1.0

Field Summary
 
Fields inherited from interface org.jscience.ml.om.IFinding
XML_ELEMENT_DESCRIPTION, XML_ELEMENT_FINDING
 
Fields inherited from interface org.jscience.ml.om.ISchemaElement
XML_ELEMENT_ATTRIBUTE_ID
 
Fields inherited from interface org.jscience.ml.om.IExtendableSchemaElement
XML_XSI_TYPE
 
Constructor Summary
protected Finding(org.w3c.dom.Node findingElement)
          Protected constructor used by subclasses construction.
protected Finding(java.lang.String description)
          Protected constructor used by subclasses construction.
protected Finding(java.lang.String ID, java.lang.String description)
          Protected constructor used by subclasses construction.
 
Method Summary
abstract  org.w3c.dom.Element addToXmlElement(org.w3c.dom.Element parent)
          Adds the Finding to an given parent XML DOM Element.
protected  org.w3c.dom.Element createXmlFindingElement(org.w3c.dom.Element parent)
          Creates an XML DOM Element for the Finding.
 java.lang.String getDescription()
          Returns the description of the Finding.
 void setDescription(java.lang.String description)
          Sets the description of the Finding.
 
Methods inherited from class org.jscience.ml.om.SchemaElement
getDisplayName, getID, setID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jscience.ml.om.ISchemaElement
getDisplayName, getID
 
Methods inherited from interface org.jscience.ml.om.IExtendableSchemaElement
getXSIType
 

Constructor Detail

Finding

protected Finding(org.w3c.dom.Node findingElement)
           throws SchemaException
Protected constructor used by subclasses construction.

Parameters:
findingElement - The XML Node representing this Finding
Throws:
SchemaException - if the XML element is malformed

Finding

protected Finding(java.lang.String ID,
                  java.lang.String description)
           throws java.lang.IllegalArgumentException
Protected constructor used by subclasses construction.

Parameters:
ID - This elements unique ID
description - The description of the finding
Throws:
java.lang.IllegalArgumentException - if description was null

Finding

protected Finding(java.lang.String description)
           throws java.lang.IllegalArgumentException
Protected constructor used by subclasses construction.

Parameters:
description - The description of the finding
Throws:
java.lang.IllegalArgumentException - if description was null
Method Detail

addToXmlElement

public abstract org.w3c.dom.Element addToXmlElement(org.w3c.dom.Element parent)
Adds the Finding to an given parent XML DOM Element. This abstract method is derived from org.jscience.ml.om.IFinding.

Specified by:
addToXmlElement in interface IFinding
Parameters:
parent - The parent element for the Finding
Returns:
Returns the Element given as parameter with the Finding as child Element.
See Also:
Element, IFinding

getDescription

public java.lang.String getDescription()
Returns the description of the Finding. The string describes the impressions the observer had during the observation of an object.

Specified by:
getDescription in interface IFinding
Returns:
The description of the finding.

setDescription

public void setDescription(java.lang.String description)
                    throws java.lang.IllegalArgumentException
Sets the description of the Finding. The string should describe the impressions the observer had during the observation of an object.

Specified by:
setDescription in interface IFinding
Parameters:
description - A description of the finding.
Throws:
java.lang.IllegalArgumentException - if description was null

createXmlFindingElement

protected org.w3c.dom.Element createXmlFindingElement(org.w3c.dom.Element parent)
Creates an XML DOM Element for the Finding. The new Finding element will be added as child element to an given parent element. All specialised subclasses may use this method to create a Finding element under which they may store their addition data.
Example:
<parentElement>
<result>
More specialised stuff goes here
</result>
</parentElement>

Parameters:
parent - The parent element for the Finding
Returns:
Returns a Finding element which is a child of the given parent element.
* Might return null if parent was null.
See Also:
Element