Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## de.jstacs.results
Class SampleResult

    java.lang.Object
      de.jstacs.results.Result
          de.jstacs.results.SampleResult

All Implemented Interfaces:
  Storable

    public class SampleResult

extends Result

Result that contains a `Sample`. This `Sample` e.g. may have been created by `Model.emitSample(int, int...)`, or may be a `Sample` that has been annotated in a classification.

Author:
  Jan Grau

Field Summary

Fields inherited from class de.jstacs.results.Result
`comment, datatype, name`

Constructor Summary
`SampleResult(StringBuffer source)` Re-creates a `SampleResult` from its XML-representation as returned by `toXML()`.
`SampleResult(String name, String comment, Sample data)` Creates a new `SampleResult` from a `Sample` with the annotation `name` and `comment`.

Method Summary
`protected void` | `fromXML(StringBuffer rep)` This method is used in `Result.Result(StringBuffer)` to extract the information.
`Sample` | `getResult()` Returns the value of the result.
`StringBuffer` | `toXML()` This method returns an XML-representation of an instance of the implementing class.

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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SampleResult

    public SampleResult(String name,
                        String comment,
                        Sample data)

  Creates a new `SampleResult` from a `Sample` with the annotation `name` and `comment`.

  Parameters:
    `name` - the name of the `Result`
    `comment` - the comment on the `Result`
    `data` - the `Sample` that is the result of some computation

### SampleResult

    public SampleResult(StringBuffer source)
                 throws NonParsableException

  Re-creates a `SampleResult` from its XML-representation as returned by `toXML()`.

  Parameters:
    `source` - the XML-representation
  Throws:
    `NonParsableException` - is thrown if the XML-code could not be parsed

Method Detail

### fromXML

    protected void fromXML(StringBuffer rep)
                    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.

  Specified by:
    `fromXML` in class `Result`
  Parameters:
    `rep` - a xml represenation
  Throws:
    `NonParsableException` - if the xml representation is not parsable
  See Also:
    `Result.extractMainInfo(StringBuffer)`

### getResult

    public Sample getResult()

  Description copied from class: `Result`
  Returns the value of the result.

  Specified by:
    `getResult` in class `Result`
  Returns:
    the value

### toXML

    public StringBuffer toXML()

  Description copied from interface: `Storable`
  This method returns an XML-representation of an instance of the implementing class.

  Returns:
    the XML-representation

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD