de.jstacs.results
Class ImageResult

java.lang.Object
  extended by de.jstacs.results.Result
      extended by de.jstacs.results.ImageResult
All Implemented Interfaces:
Storable

public class ImageResult
extends Result

A class for results that are images of the PNG format. The images themselves cannot be stored to an XML representation and thus only the description (name, etc.) is stored.

Author:
Jan Grau

Field Summary
 
Fields inherited from class de.jstacs.results.Result
comment, datatype, name
 
Constructor Summary
ImageResult(String name, String comment, BufferedImage image)
          Constructs a new ImageResult from a BufferedImage.
 
Method Summary
protected  void fromXML(StringBuffer representation)
          This method is used in Result.Result(StringBuffer) to extract the information.
 BufferedImage getResult()
          Returns the value of the Result.
 String toString()
           
 StringBuffer toXML()
          This method returns an XML representation as StringBuffer 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, wait, wait, wait
 

Constructor Detail

ImageResult

public ImageResult(String name,
                   String comment,
                   BufferedImage image)
Constructs a new ImageResult from a BufferedImage.

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

getResult

public BufferedImage getResult()
Description copied from class: Result
Returns the value of the Result.

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

toXML

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

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.

Specified by:
fromXML in class Result
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)

toString

public String toString()
Overrides:
toString in class Object