org.jscience.ml.om
Class GenericFinding

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

public class GenericFinding
extends Finding

The class GenericFinding provides a generic implementation of org.jscience.ml.om.IFinding.
The GenericFinding class stores a description of the findings and provides simple access to this description field.

Since:
1.3

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
GenericFinding(org.w3c.dom.Node findingElement)
           
GenericFinding(java.lang.String description)
           
GenericFinding(java.lang.String ID, java.lang.String description)
           
 
Method Summary
 org.w3c.dom.Element addToXmlElement(org.w3c.dom.Element parent)
          Adds this GenericFinding to an given parent XML DOM Element.
 boolean equals(java.lang.Object obj)
          Overwrittes equals(Object) method from java.lang.Object.
 java.lang.String getDisplayName()
          Returns a display name for this element.
 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.Finding
createXmlFindingElement, getDescription, setDescription
 
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

GenericFinding

public GenericFinding(org.w3c.dom.Node findingElement)
               throws SchemaException
Throws:
SchemaException

GenericFinding

public GenericFinding(java.lang.String description)
               throws SchemaException
Throws:
SchemaException

GenericFinding

public GenericFinding(java.lang.String ID,
                      java.lang.String description)
               throws SchemaException
Throws:
SchemaException
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 field values of this GenericFinding.

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

equals

public boolean equals(java.lang.Object obj)
Overwrittes equals(Object) method from java.lang.Object.
Checks if this GenericFinding and the given Object are equal. Two GenericFinding are equal if both return the same string from their toString() method and both XSI types are equal.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The Object to compare this GenericFinding with.
Returns:
true if both Objects are instances from class GenericFinding, their XSI type is equal and their fields contain the same values. (Can be checked with calling and comparing both objects toString() method)
See Also:
Object

getXSIType

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


Returns:
The xsi:type value of this implementation

addToXmlElement

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

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