de.jstacs.results
Class SimpleResult

java.lang.Object
  extended by de.jstacs.AnnotatedEntity
      extended by de.jstacs.results.Result
          extended by de.jstacs.results.SimpleResult
All Implemented Interfaces:
Storable, Comparable<SimpleResult>
Direct Known Subclasses:
CategoricalResult, NumericalResult

public abstract class SimpleResult
extends Result
implements Comparable<SimpleResult>

Abstract class for a Result with a value of a primitive data type or String.

Author:
Jan Grau, Jens Keilwagen
See Also:
Result

Field Summary
protected  Comparable result
          The result.
 
Fields inherited from class de.jstacs.AnnotatedEntity
comment, datatype, name
 
Constructor Summary
protected SimpleResult(StringBuffer rep)
          This is the constructor for Storable.
protected SimpleResult(String name, String comment, DataType datatype)
          The main constructor which takes the main information of a result.
 
Method Summary
protected  void appendFurtherInfos(StringBuffer buf)
          This method can be used in the method Storable.toXML() to extract further information (name, comment, datatype).
 int compareTo(SimpleResult r)
           
 boolean equals(Object arg)
           
protected  void extractFurtherInfos(StringBuffer representation)
          This method can be used in the constructor with parameter StringBuffer to extract the further information.
 Comparable getValue()
          Returns the value of the AnnotatedEntity.
 String toString()
           
 
Methods inherited from class de.jstacs.results.Result
checkDatatype, createResult, isCastableResult, isComparableResult
 
Methods inherited from class de.jstacs.AnnotatedEntity
getComment, getDatatype, getName, getXMLTag, toXML
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

result

protected Comparable result
The result.

Constructor Detail

SimpleResult

protected SimpleResult(String name,
                       String comment,
                       DataType datatype)
The main constructor which takes the main information of a result.

Parameters:
name - the name of the result
comment - the comment for the result
datatype - the data type of the result

SimpleResult

protected SimpleResult(StringBuffer rep)
                throws NonParsableException
This is the constructor for Storable. Creates a new SimpleResult out of the XML representation as returned by AnnotatedEntity.toXML().

Parameters:
rep - the XML representation as StringBuffer
Throws:
NonParsableException - if the representation could not be parsed.
Method Detail

appendFurtherInfos

protected void appendFurtherInfos(StringBuffer buf)
Description copied from class: AnnotatedEntity
This method can be used in the method Storable.toXML() to extract further information (name, comment, datatype).

Specified by:
appendFurtherInfos in class AnnotatedEntity
Parameters:
buf - a XML representation of the main information as StringBuffer
See Also:
Storable.toXML()

extractFurtherInfos

protected void extractFurtherInfos(StringBuffer representation)
                            throws NonParsableException
Description copied from class: AnnotatedEntity
This method can be used in the constructor with parameter StringBuffer to extract the further information.

Specified by:
extractFurtherInfos in class AnnotatedEntity
Parameters:
representation - a XML represenation of the main information as StringBuffer
Throws:
NonParsableException - if the XML representation is not parsable
See Also:
AnnotatedEntity.AnnotatedEntity(StringBuffer)

getValue

public Comparable getValue()
Description copied from class: AnnotatedEntity
Returns the value of the AnnotatedEntity.

Specified by:
getValue in class AnnotatedEntity
Returns:
the value of the AnnotatedEntity

toString

public String toString()
Overrides:
toString in class Object

compareTo

public int compareTo(SimpleResult r)
Specified by:
compareTo in interface Comparable<SimpleResult>

equals

public boolean equals(Object arg)
Overrides:
equals in class Object