de.jstacs.results
Class CategoricalResult

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

public class CategoricalResult
extends SimpleResult

A class for categorical results (i.e. non-numerical results) for primitives and Strings.

Author:
Jan Grau

Field Summary
 
Fields inherited from class de.jstacs.results.SimpleResult
result
 
Fields inherited from class de.jstacs.results.Result
comment, datatype, name
 
Constructor Summary
CategoricalResult(DataType datatype, String name, String comment, Comparable result)
          Creates a result of a primitive categorical data type or a String .
CategoricalResult(StringBuffer representation)
          The standard constructor for the interface Storable.
CategoricalResult(String name, String comment, boolean result)
          Creates a result of a boolean.
CategoricalResult(String name, String comment, String result)
          Creates a result of a String.
 
Method Summary
protected  void fromXML(StringBuffer representation)
          This method is used in Result.Result(StringBuffer) to extract the information.
 StringBuffer toXML()
          This method returns an XML representation as StringBuffer of an instance of the implementing class.
 
Methods inherited from class de.jstacs.results.SimpleResult
compareTo, equals, getResult, toString
 
Methods inherited from class de.jstacs.results.Result
appendMainInfo, checkDatatype, createResult, extractMainInfo, getComment, getDatatype, getName, isCastableResult, isComparableResult
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CategoricalResult

public CategoricalResult(StringBuffer representation)
                  throws NonParsableException
The standard constructor for the interface Storable. Creates a new CategoricalResult from its XML representation.

Parameters:
representation - the XML representation as StringBuffer
Throws:
NonParsableException - if the StringBuffer representation could not be parsed

CategoricalResult

public CategoricalResult(DataType datatype,
                         String name,
                         String comment,
                         Comparable result)
                  throws SimpleParameter.IllegalValueException
Creates a result of a primitive categorical data type or a String .

Parameters:
datatype - the primitive data type
name - the name of the result
comment - a comment on the result
result - the result itself
Throws:
SimpleParameter.IllegalValueException - if the result value is not of the expected data type

CategoricalResult

public CategoricalResult(String name,
                         String comment,
                         String result)
Creates a result of a String.

Parameters:
name - the name of the result
comment - a comment on the result
result - the result itself

CategoricalResult

public CategoricalResult(String name,
                         String comment,
                         boolean result)
Creates a result of a boolean.

Parameters:
name - the name of the result
comment - a comment on the result
result - the result itself
Method Detail

toXML

public StringBuffer toXML()
Description copied from interface: Storable
This method returns an XML representation as StringBuffer of an instance of the implementing class.

Specified by:
toXML in interface Storable
Overrides:
toXML in class SimpleResult
Returns:
the XML representation

fromXML

protected void fromXML(StringBuffer representation)
                throws NonParsableException
Description copied from class: Result
This method is used in Result.Result(StringBuffer) to extract the information. The method can be seen as opposite of Storable.toXML() and should not be made public.

Overrides:
fromXML in class SimpleResult
Parameters:
representation - the XML represenation of the Result to be parsed
Throws:
NonParsableException - if the XML representation is not parsable
See Also:
Result.extractMainInfo(StringBuffer)