com.rapidminer.operator
Class ResultObjectAdapter

java.lang.Object
  extended by com.rapidminer.operator.AbstractIOObject
      extended by com.rapidminer.operator.ResultObjectAdapter
All Implemented Interfaces:
IOObject, ResultObject, Saveable, LoggingHandler, java.io.Serializable
Direct Known Subclasses:
AbstractExampleSet, AbstractModel, ANOVAMatrix, AssociationRules, Averagable, AverageVector, ClusterModel, DataStatistics, FrequentItemSets, HierarchicalClusterModel, IGSSResult, LiftParetoChart, NumericalMatrix, ParameterSet, ROCComparison, RunVector, SignificanceTestResult, SimilarityMeasure, SimpleResultObject, TextObject, Threshold, TransitionGraph, WekaAssociator

public abstract class ResultObjectAdapter
extends AbstractIOObject
implements ResultObject, LoggingHandler, Saveable

An adapter class for the interface ResultObject. Implements most methods and can be used if the subclass does not need to extend other classes. The method toResultString() delivers the return value of Object.toString(). The visualization components for the graphical user interface is simply the HTML representation of the result string. If a subclass also implements Saveable an action for Saving will automatically be added to the actions list.

Author:
Ingo Mierswa, Simon Fischer Exp $
See Also:
Serialized Form

Constructor Summary
ResultObjectAdapter()
           
 
Method Summary
protected  void addAction(javax.swing.Action a)
          Adds an action to the list of Java Swing Actions which will shown in the visualization component.
 java.util.List<javax.swing.Action> getActions()
          Returns a list of all actions which can be performed for this result object.
 java.lang.String getName()
          The default implementation returns the classname without package.
 javax.swing.Icon getResultIcon()
          Returns null.
 java.awt.Component getVisualizationComponent(IOContainer container)
          Returns a editor pane that displays the toResultString() result encoded as html.
 boolean isSavable()
          Returns true.
 void log(java.lang.String message)
          Logs a status message with the correct log service.
 void logError(java.lang.String message)
          Logs an error message with the correct log service.
 void logNote(java.lang.String message)
          Logs a note message with the correct log service.
 void logWarning(java.lang.String message)
          Logs a warning message with the correct log service.
 void save(java.io.File file)
          Saves the object into the given file by using the AbstractIOObject.write(OutputStream) method of IOObject (XML format).
static java.lang.String toHTML(java.lang.String string)
          Encodes the given String as HTML.
 java.lang.String toResultString()
          The default implementation simply returns the result of the method Object.toString().
 
Methods inherited from class com.rapidminer.operator.AbstractIOObject
copy, getLog, getSource, initWriting, read, setLoggingHandler, setSource, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.rapidminer.operator.IOObject
copy, getLog, getSource, setLoggingHandler, setSource, write
 
Methods inherited from interface com.rapidminer.operator.Saveable
getExtension, getFileDescription
 

Constructor Detail

ResultObjectAdapter

public ResultObjectAdapter()
Method Detail

getName

public java.lang.String getName()
The default implementation returns the classname without package.

Specified by:
getName in interface ResultObject

isSavable

public boolean isSavable()
Returns true.

Specified by:
isSavable in interface Saveable

save

public void save(java.io.File file)
          throws java.io.IOException
Saves the object into the given file by using the AbstractIOObject.write(OutputStream) method of IOObject (XML format).

Specified by:
save in interface Saveable
Throws:
java.io.IOException

addAction

protected void addAction(javax.swing.Action a)
Adds an action to the list of Java Swing Actions which will shown in the visualization component. If the class implements Saveable an action for saving is already added.


getActions

public java.util.List<javax.swing.Action> getActions()
Returns a list of all actions which can be performed for this result object.

Specified by:
getActions in interface ResultObject

toResultString

public java.lang.String toResultString()
The default implementation simply returns the result of the method Object.toString().

Specified by:
toResultString in interface ResultObject

getResultIcon

public javax.swing.Icon getResultIcon()
Returns null. Subclasses might want to override this method and returns an appropriate icon.

Specified by:
getResultIcon in interface ResultObject

getVisualizationComponent

public java.awt.Component getVisualizationComponent(IOContainer container)
Returns a editor pane that displays the toResultString() result encoded as html. Please note that the returned pane is already enclosed by a scroll pane. If you overwrite this method you should again ensure that the returned component is scrollable. The given container is totally ignored.

Specified by:
getVisualizationComponent in interface ResultObject

toHTML

public static java.lang.String toHTML(java.lang.String string)
Encodes the given String as HTML. Only linebreaks and less then and greater than will be encoded.


log

public void log(java.lang.String message)
Logs a status message with the correct log service.

Specified by:
log in interface LoggingHandler

logNote

public void logNote(java.lang.String message)
Logs a note message with the correct log service.

Specified by:
logNote in interface LoggingHandler

logWarning

public void logWarning(java.lang.String message)
Logs a warning message with the correct log service.

Specified by:
logWarning in interface LoggingHandler

logError

public void logError(java.lang.String message)
Logs an error message with the correct log service.

Specified by:
logError in interface LoggingHandler


Copyright © 2001-2009 by Rapid-I