com.rapidminer.operator
Class Operator

java.lang.Object
  extended by com.rapidminer.operator.Operator
All Implemented Interfaces:
ConfigurationListener, PreviewListener, ParameterHandler, LoggingHandler
Direct Known Subclasses:
AbstractClusterer, AbstractExampleSetEvaluator, AbstractExampleSetJoin, AbstractExampleSetProcessing, AbstractLearner, AbstractPairwiseMatrixOperator, AbstractPerformanceEvaluator, AbstractReader, AbstractWeighting, AbstractWriter, AgglomerativeClustering, ANOVAMatrixOperator, AssociationRuleGenerator, AttributeConstructionsLoader, AttributeConstructionsWriter, AttributeWeights2ExampleSet, AttributeWeightsApplier, AttributeWeightSelection, AverageBuilder, CentroidBasedEvaluator, ClearProcessLog, ClusterDensityEvaluator, ClusterModel2ExampleSet, ClusterModelWriter, ClusterNumberEvaluator, ClusterToPrediction, CommandLineOperator, ComponentWeights, CorrelationMatrixOperator, CostEvaluator, CovarianceMatrixOperator, Data2Log, DatabaseExampleVisualizationOperator, DataMacroDefinitionOperator, DataStatisticsOperator, DimensionalityReducer, ExampleDistributionEvaluator, ExampleSet2AttributeWeights, ExampleSet2ClusterModel, ExampleSet2Similarity, ExampleSet2SimilarityExampleSet, ExampleSetIntersect, ExampleSetMerge, ExampleSetMinus, ExampleSetSuperset, ExampleSetTransformationOperator, ExampleSetUnion, ExampleVisualizationOperator, FastICA, FileEchoOperator, FlattenClusterModel, FormulaExtractor, FPGrowth, FrequentItemSetAttributeCreator, FrequentItemSetUnificator, GenericWekaAssociationLearner, GHA, GNUPlotOperator, GroupByOperator, GroupedANOVAOperator, InteractiveAttributeWeighting, IOConsumeOperator, IOContainerReader, IOContainerWriter, IOMultiplyOperator, IOObjectReader, IOObjectWriter, IORetrievalOperator, IOSelectOperator, IOStorageOperator, KernelPCA, LagSeries, LiftChartGenerator, LiftParetoChartGenerator, Macro2Log, MacroConstructionOperator, MacroDefinitionOperator, MemoryCleanUp, MinMaxWrapper, ModelApplier, ModelGrouper, ModelUngrouper, ModelUpdater, NonDominatedSorting, OperatorChain, ParameterCloner, ParameterSetter, PartitionOperator, PCA, PlattScaling, PreprocessingOperator, ProcessEmbeddingOperator, ProcessLog2AttributeWeights, ProcessLog2ExampleSet, ProcessLogOperator, RainflowMatrixOperator, ResultWriter, ROCChartGenerator, ScriptingOperator, SignificanceTestOperator, Similarity2ExampleSet, SingleMacroDefinitionOperator, SingleTextObjectInput, SOMDimensionalityReduction, SOMModelVisualization, SQLExecution, SupportVectorCounter, TestEvaluator, TextCleaner, TextExtractor, TextObject2ExampleSet, TextObjectLoader, TextObjectWriter, ThresholdApplier, ThresholdCreator, ThresholdFinder, TransitionGraphOperator, TransitionMatrixOperator, WeightedPerformanceCreator

public abstract class Operator
extends java.lang.Object
implements ConfigurationListener, PreviewListener, LoggingHandler, ParameterHandler

An operator accepts an array of input objects and generates an array of output objects that can be processed by other operators. Both must implement the IOObject interface. This is the superclass which must be extended by all RapidMiner operators. Please refer to the RapidMiner tutorial for a detailed description how to implement your operator.

As default, operators consume their input by using it. This is often a useful behavior especially in complex processes. For example, a learning operator consumes an example set to produce a model and so does a cross validation to produce a performance value of the learning method. To receive the input IOObject of a certain class simply use getInput(Class class). This method delivers the first object of the desired class which is in the input of this operator. The delivered object is consumed afterwards and thus is removed from input. If the operator alters this object, it should return the altered object as output again. Therefore, you have to add the object to the output array which is delivered by the apply() method of the operator. You also have to declare it in getOutputClasses(). All input objects which are not used by your operator will be automatically passed to the next operators.

In some cases it would be useful if the user can define if the input object should be consumed or not. For example, a validation chain like cross validation should estimate the performance but should also be able to return the example set which is then used to learn the overall model. Operators can change the default behavior for input consumation and a parameter will be automatically defined and queried. The default behavior is defined in the method getInputDescription(Class cls) and should be overriden in these cases. Please note that input objects with a changed input description must not be defined in getOutputClasses() and must not be returned at the end of apply. Both is automatically done with respect to the value of the automatically created parameter. Please refer to the Javadoc comments of this method for further explanations.

Author:
Ralf Klinkenberg, Ingo Mierswa, Simon Fischer
See Also:
OperatorChain

Constructor Summary
Operator(OperatorDescription description)
           Creates an unnamed operator.
 
Method Summary
 void addError(java.lang.String message)
          Adds an error message.
 void addValue(Value value)
          Adds an implementation of Value.
 void addWarning(java.lang.String message)
          Adds a warning message to the error list.
abstract  IOObject[] apply()
          Implement this method in subclasses.
 IOContainer apply(IOContainer input)
          Applies the operator.
 int checkDeprecations()
          Will count an the number of deprecated operators, i.e. the operators which getDeprecationInfo() method does not return null.
protected  void checkForStop()
           
 java.lang.Class<?>[] checkIO(java.lang.Class<?>[] input)
          Subclasses will throw an exception if something isn't ok.
 int checkProperties()
          Will count an error if a non optional property has no default value and is not defined by user.
 void clearErrorList()
          Clears the list of errors.
 Operator cloneOperator(java.lang.String name)
          Performs a deep clone on the most parts of this operator.
 java.lang.String createExperimentTree(int indent)
          Deprecated. Use createProcessTree(int) instead
protected  java.lang.String createExperimentTree(int indent, java.lang.String selfPrefix, java.lang.String childPrefix, Operator markOperator, java.lang.String mark)
          Deprecated. Use createProcessTree(int,String,String,Operator,String) instead
static Operator createFromXML(org.w3c.dom.Element element, java.util.List<UnknownParameterInformation> unknownParameterInformation)
           
 java.lang.String createMarkedExperimentTree(int indent, java.lang.String mark, Operator markOperator)
          Deprecated. Use createMarkedProcessTree(int,String,Operator) instead
 java.lang.String createMarkedProcessTree(int indent, java.lang.String mark, Operator markOperator)
          Returns this operator's name and class.
 java.lang.String createProcessTree(int indent)
          Returns this operator's name and class.
protected  java.lang.String createProcessTree(int indent, java.lang.String selfPrefix, java.lang.String childPrefix, Operator markOperator, java.lang.String mark)
          Returns this operator's name and class.
 boolean getAddOnlyAdditionalOutput()
          Indicates how additional output should be added to the IOContainer.
 int getApplyCount()
          Returns the number of times this operator was already applied.
protected  java.lang.Class<?>[] getDeliveredOutputClasses()
          Returns the classes that are guaranteed to be returned by apply().
 java.lang.String getDeprecationInfo()
          Returns null if this operator is not deprecated.
protected  java.lang.Class<?>[] getDesiredInputClasses()
          Returns the classes that are needed as input.
 java.nio.charset.Charset getEncoding()
          Returns the encoding if defined by the root operator if this operator is part of a process or the standard encoding defined via the system property.
 java.util.List<java.lang.String> getErrorList()
          Returns a List of Strings containing error messages.
 Process getExperiment()
          Deprecated. Please use getProcess() instead
protected  java.lang.String getInnerOperatorsXML(java.lang.String indent, boolean hideDefault)
          Writes the XML representation of the inner operators.
protected  IOContainer getInput()
          Returns the complete input.
protected
<T extends IOObject>
T
getInput(java.lang.Class<T> cls)
          Returns an IOObject of class cls.
protected
<T extends IOObject>
T
getInput(java.lang.Class<T> cls, int nr)
          Returns the nr-th IOObject of class cls.
abstract  java.lang.Class<?>[] getInputClasses()
          Returns the classes that are needed as input.
protected  InputDescription getInputDescription(java.lang.Class<?> inputClass)
          The default implementation returns an input description that consumes the input IOObject without a user parameter.
protected  IOContainer getIOContainerForInApplyLoopBreakpoint()
          Returns the intermediate results of an in-apply-loop which will be displayed in case of a BreakpointListener.BREAKPOINT_WITHIN.
protected  IODescription getIODescription()
          If you find the getInputClasses() and getOuputClasses() methods for some reason not useful, you may override this method.
 LogService getLog()
          Returns the logging of the process if this operator is part of an process and the global logging service otherwise.
 java.lang.String getName()
          Returns the name of the operator.
 java.lang.String getOperatorClassName()
          Returns the "class name" of this operator from the operator description of the operator.
 OperatorDescription getOperatorDescription()
          Returns the operator description of this operator.
abstract  java.lang.Class<?>[] getOutputClasses()
          Returns the classes that are guaranteed to be returned by apply() as additional output.
 java.lang.String getParameter(java.lang.String key)
          Returns a single parameter retrieved from the Parameters of this Operator.
 boolean getParameterAsBoolean(java.lang.String key)
          Returns a single named parameter and casts it to boolean.
 java.awt.Color getParameterAsColor(java.lang.String key)
          Returns a single named parameter and casts it to Color.
 double getParameterAsDouble(java.lang.String key)
          Returns a single named parameter and casts it to double.
 java.io.File getParameterAsFile(java.lang.String key)
          Returns a single named parameter and casts it to File.
 java.io.File getParameterAsFile(java.lang.String key, boolean createMissingDirectories)
          Returns a single named parameter and casts it to File.
 java.io.InputStream getParameterAsInputStream(java.lang.String key)
          Returns a single named parameter and tries to handle it as URL.
 int getParameterAsInt(java.lang.String key)
          Returns a single named parameter and casts it to int.
 double[][] getParameterAsMatrix(java.lang.String key)
          Returns a single named parameter and casts it to a double matrix.
 java.lang.String getParameterAsString(java.lang.String key)
          Returns a single named parameter and casts it to String.
 java.util.List<java.lang.String[]> getParameterList(java.lang.String key)
          Returns a single named parameter and casts it to List.
 Parameters getParameters()
          Returns a collection of all parameters of this operator.
 ParameterType getParameterType(java.lang.String name)
          Returns the parameter type with the given name.
 java.util.List<ParameterType> getParameterTypes()
          Returns a list of ParameterTypes describing the parameters of this operator.
 OperatorChain getParent()
          Returns the parent of this operator which must be an operator chain.
 Process getProcess()
          Returns the process of this operator by asking the parent operator.
 long getStartTime()
          Returns the system time when the operator was started.
 java.lang.String getStatus()
          Returns human readable status information.
 java.lang.String getUserDescription()
          The user specified comment for this operator.
 Value getValue(java.lang.String key)
          Returns the value of the Value with the given key.
 java.util.Collection<Value> getValues()
          Returns all Values sorted by key.
 java.lang.String getXML(java.lang.String indent, boolean hideDefault)
          Returns the XML representation of this operator.
 boolean hasBreakpoint()
          Returns true iff this operator has a breakpoint at any possible position.
 boolean hasBreakpoint(int position)
          Returns true iff a breakpoint is set at the given position
protected  boolean hasInput(java.lang.Class<? extends IOObject> cls)
          Returns true if this operator has an input object of the desired class.
 void inApplyLoop()
          Should be called if this operator performs a loop (for the loop time resetting used for Value creation used by DataTables).
 boolean isDebugMode()
           
 boolean isEnabled()
          Returns true if this operator is enabled and the parent (if not null) is also enabled.
 boolean isExpanded()
          Returns true if this operator should be painted expanded.
 boolean isParallel()
          This method must return true if the operator performs parallel execution of child operators and false otherwise.
 boolean isParameterSet(java.lang.String key)
          Returns true iff the parameter with the given name is set.
 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 performAdditionalChecks()
          This method is invoked during the validation checks.
 void processFinished()
          Called at the end of the process.
 void processStarts()
          Called when the process starts.
 void register(Process process, java.lang.String name)
          Deprecated. No longer necessary since the registering / unregistering will be performed during operator adding
protected  void registerOperator(Process process)
          Registers this operator in the given process.
 void remove()
          Removes this operator from its parent.
 java.lang.String rename(java.lang.String newName)
          This method unregisters the old name if this operator is already part of a Process.
 void resume()
          Deprecated. Use Process.resume()
 void setApplyCount(int applyCount)
           
 void setBreakpoint(int position, boolean on)
          Sets or clears a breakpoint at the given position.
 void setEnabled(boolean enabled)
          Sets the activation mode.
 void setExpanded(boolean expanded)
          Sets the expansion mode which indicates if this operator is drawn expanded or not.
protected  void setInput(IOContainer input)
          ATTENTION: Use this method only if you are ABSOLUTELY sure what you are doing!
 void setListParameter(java.lang.String key, java.util.List<java.lang.String[]> list)
          Sets the given parameter list to the Parameters object of this operator.
 void setOperatorParameters(org.w3c.dom.Element element, java.util.List<UnknownParameterInformation> unknownParameterInformation)
          Sets all parameters of this operator (including inner operators and their parameters).
 void setParameter(java.lang.String key, java.lang.String value)
          Sets the given single parameter to the Parameters object of this operator.
 void setParameters(Parameters parameters)
          Sets all parameters of this operator.
 void setParent(OperatorChain parent)
          Sets the enclosing operator chain.
 void setUserDescription(java.lang.String description)
          Sets the user specified comment for this operator.
 java.lang.String toString()
          Returns the name.
protected  void unregisterOperator(Process process)
          Deletes this operator removing it from the name map of the process.
 void writeXML(java.io.PrintWriter out, java.lang.String indent, boolean hideDefault)
          Writes the XML representation of this operator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Operator

public Operator(OperatorDescription description)

Creates an unnamed operator. Subclasses must pass the given description object to this super-constructor (i.e. invoking super(OperatorDescription)). They might also add additional values for process logging.

NOTE: the preferred way for operator creation is using one of the factory methods of OperatorService.

Method Detail

getOperatorDescription

public final OperatorDescription getOperatorDescription()
Returns the operator description of this operator.


getOperatorClassName

public final java.lang.String getOperatorClassName()
Returns the "class name" of this operator from the operator description of the operator. This is the name which is defined in the operator.xml file.


getExperiment

@Deprecated
public Process getExperiment()
Deprecated. Please use getProcess() instead

Returns the experiment (process) of this operator by asking the parent operator. If the operator itself and all of its parents are not part of an process, this method will return null. Please note that some operators (e.g. ProcessLog) must be part of an process in order to work properly.


getProcess

public Process getProcess()
Returns the process of this operator by asking the parent operator. If the operator itself and all of its parents are not part of an process, this method will return null. Please note that some operators (e.g. ProcessLog) must be part of an process in order to work properly.

Specified by:
getProcess in interface ConfigurationListener
Specified by:
getProcess in interface PreviewListener

getLog

public LogService getLog()
Returns the logging of the process if this operator is part of an process and the global logging service otherwise.


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

getName

public final java.lang.String getName()
Returns the name of the operator.


rename

public final java.lang.String rename(java.lang.String newName)
This method unregisters the old name if this operator is already part of a Process. Afterwards, the new name is set and registered in the process. Please note that the name might be changed during registering in order to ensure that each operator name is unique in its process. The new name will be returned.


setUserDescription

public void setUserDescription(java.lang.String description)
Sets the user specified comment for this operator.


getUserDescription

public java.lang.String getUserDescription()
The user specified comment for this operator.


getDeprecationInfo

public final java.lang.String getDeprecationInfo()
Returns null if this operator is not deprecated. This implementation returns the return value of OperatorDescription.getDeprecationInfo() which is usually null. If a non-null value is returned this should describe a a workaround for a user. In this case the workaround is displayed during the validation of the process.


setParent

public final void setParent(OperatorChain parent)
Sets the enclosing operator chain.


getParent

public final OperatorChain getParent()
Returns the parent of this operator which must be an operator chain.


remove

public void remove()
Removes this operator from its parent.


register

@Deprecated
public void register(Process process,
                                java.lang.String name)
Deprecated. No longer necessary since the registering / unregistering will be performed during operator adding

This methods was used in older RapidMiner version for registering the operator in the process and to ensure that all operator names are unique. This is now automatically done during operator adding and therefore this method is now deprecated.


registerOperator

protected void registerOperator(Process process)
Registers this operator in the given process. Please note that this might change the name of the operator.


unregisterOperator

protected void unregisterOperator(Process process)
Deletes this operator removing it from the name map of the process.


setEnabled

public void setEnabled(boolean enabled)
Sets the activation mode. Inactive operators do not perform their action.


setExpanded

public void setExpanded(boolean expanded)
Sets the expansion mode which indicates if this operator is drawn expanded or not.


isExpanded

public boolean isExpanded()
Returns true if this operator should be painted expanded.


isEnabled

public boolean isEnabled()
Returns true if this operator is enabled and the parent (if not null) is also enabled.


isParallel

public boolean isParallel()
This method must return true if the operator performs parallel execution of child operators and false otherwise.


getStatus

public java.lang.String getStatus()
Returns human readable status information.


getApplyCount

public int getApplyCount()
Returns the number of times this operator was already applied.


cloneOperator

public Operator cloneOperator(java.lang.String name)
Performs a deep clone on the most parts of this operator. The breakpointThread is empty (as it is in initialization). The parent will be clone in the method of OperatorChain overwriting this one. The in- and output containers and the error list are only cloned by reference copying. Use this method only if you are sure what you are doing.


apply

public abstract IOObject[] apply()
                          throws OperatorException
Implement this method in subclasses.

Throws:
OperatorException

getInputClasses

public abstract java.lang.Class<?>[] getInputClasses()
Returns the classes that are needed as input. May be null or an empty (no desired input). As default, all delivered input objects are consumed and must be also delivered as output in both getOutputClasses() and apply() if this is necessary. This default behavior can be changed by overriding getInputDescription(Class). Subclasses which implement this method should not make use of parameters since this method is invoked by getParameterTypes(). Therefore, parameters are not fully available at this point of time and this might lead to exceptions. Please use InputDescriptions instead.


getOutputClasses

public abstract java.lang.Class<?>[] getOutputClasses()

Returns the classes that are guaranteed to be returned by apply() as additional output. Please note that input objects which should not be consumed must also be defined by this method (e.g. an example set which is changed but not consumed in the case of a preprocessing operator must be defined in both, the methods getInputClasses() and getOutputClasses()). The default behavior for input consumation is defined by getInputDescription(Class) and can be changed by overwriting this method. Objects which are not consumed (defined by changing the implementation in getInputDescription(Class)) must not be defined as additional output in this method.

May deliver null or an empy array (no additional output is produced or guaranteed). Must return the class array of delivered output objects otherwise.


getDesiredInputClasses

protected final java.lang.Class<?>[] getDesiredInputClasses()
Returns the classes that are needed as input. Returns the result of getInputClasses().


getDeliveredOutputClasses

protected final java.lang.Class<?>[] getDeliveredOutputClasses()
Returns the classes that are guaranteed to be returned by apply(). These are all input classes which are not consumed and all guranteed additional output classes.


getInputDescription

protected InputDescription getInputDescription(java.lang.Class<?> inputClass)
The default implementation returns an input description that consumes the input IOObject without a user parameter. Subclasses may override this method to allow other input handling behaviors.


getIODescription

protected IODescription getIODescription()
If you find the getInputClasses() and getOuputClasses() methods for some reason not useful, you may override this method. Otherwise it returns a default IODescription containing the classes returned by the first.


checkIO

public java.lang.Class<?>[] checkIO(java.lang.Class<?>[] input)
                             throws IllegalInputException,
                                    WrongNumberOfInnerOperatorsException
Subclasses will throw an exception if something isn't ok. Returns the output that this operator returns when provided with the given input.

Throws:
IllegalInputException
WrongNumberOfInnerOperatorsException

performAdditionalChecks

public void performAdditionalChecks()
                             throws UserError
This method is invoked during the validation checks. It is invoked as a last check. The default implementation does nothing. Subclasses might want to override this method to perform some specialized checks, e.g. if an inner operator is of a specific class.

Throws:
UserError

checkProperties

public int checkProperties()
Will count an error if a non optional property has no default value and is not defined by user. Returns the total number of errors.


checkDeprecations

public int checkDeprecations()
Will count an the number of deprecated operators, i.e. the operators which getDeprecationInfo() method does not return null. Returns the total number of deprecations.


apply

public final IOContainer apply(IOContainer input)
                        throws OperatorException
Applies the operator. Don't override this method, but apply().

Returns:
An IOContainer containing all IOObjects returned by apply() plus the unused IOObjects of input, i.e. those IOObjects that were not returned by one of input.getInput(Class) or input.getInput(Class, int).
Throws:
OperatorException

checkForStop

protected final void checkForStop()
                           throws ProcessStoppedException
Throws:
ProcessStoppedException

resume

@Deprecated
public final void resume()
Deprecated. Use Process.resume()

This method should only be called by the command line breakpoint listener to resume the process after a breakpoint.


getAddOnlyAdditionalOutput

public boolean getAddOnlyAdditionalOutput()
Indicates how additional output should be added to the IOContainer. Usually the additional output should be preprended to the input container but some operators, especially operator chains might override this method in order add only the additional output instead of the complete IOContainer. This prevents doubling the IOObjects e.g. for SimpleOperatorChains. The default implementation returns false.


getInput

protected <T extends IOObject> T getInput(java.lang.Class<T> cls)
                               throws MissingIOObjectException
Returns an IOObject of class cls. The object is removed from the input IOContainer if the input description defines this behavior (default).

Throws:
MissingIOObjectException

getInput

protected <T extends IOObject> T getInput(java.lang.Class<T> cls,
                                          int nr)
                               throws MissingIOObjectException
Returns the nr-th IOObject of class cls. The object is removed from the input IOContainer if the input description defines this behavior (default).

Throws:
MissingIOObjectException

hasInput

protected boolean hasInput(java.lang.Class<? extends IOObject> cls)
Returns true if this operator has an input object of the desired class. The object will not be removed by using this method.


getInput

protected final IOContainer getInput()
Returns the complete input. Operators should usually not directly use this method but should use getInput(Class). However, some operator chains must handle their inner input and have to use the IOContainer directly.


setInput

protected void setInput(IOContainer input)
ATTENTION: Use this method only if you are ABSOLUTELY sure what you are doing! This method might be useful for some meta optimization operators but wrong usage can cause serious errors.


processStarts

public void processStarts()
                   throws OperatorException
Called when the process starts. Resets all counters.

Throws:
OperatorException

processFinished

public void processFinished()
                     throws OperatorException
Called at the end of the process. The default implementation does nothing.

Throws:
OperatorException

setBreakpoint

public void setBreakpoint(int position,
                          boolean on)
Sets or clears a breakpoint at the given position.

Parameters:
position - One out of BREAKPOINT_BEFORE and BREAKPOINT_AFTER

hasBreakpoint

public boolean hasBreakpoint()
Returns true iff this operator has a breakpoint at any possible position.


hasBreakpoint

public boolean hasBreakpoint(int position)
Returns true iff a breakpoint is set at the given position

Parameters:
position - One out of BREAKPOINT_BEFORE and BREAKPOINT_AFTER

inApplyLoop

public void inApplyLoop()
                 throws ProcessStoppedException
Should be called if this operator performs a loop (for the loop time resetting used for Value creation used by DataTables). Also allows for intermediate results delivered by getIOContainerForInApplyLoopBreakpoint() in case of a BreakpointListener.BREAKPOINT_WITHIN. Subclasses should invoke this method in case of a loop in their method apply(). This method also invokes checkForStop().

Throws:
ProcessStoppedException

getIOContainerForInApplyLoopBreakpoint

protected IOContainer getIOContainerForInApplyLoopBreakpoint()
Returns the intermediate results of an in-apply-loop which will be displayed in case of a BreakpointListener.BREAKPOINT_WITHIN.


addValue

public void addValue(Value value)
Adds an implementation of Value.


getValue

public final Value getValue(java.lang.String key)
Returns the value of the Value with the given key.


getValues

public java.util.Collection<Value> getValues()
Returns all Values sorted by key.


getParameters

public Parameters getParameters()
Returns a collection of all parameters of this operator.

Specified by:
getParameters in interface ConfigurationListener
Specified by:
getParameters in interface PreviewListener
Specified by:
getParameters in interface ParameterHandler

setParameters

public void setParameters(Parameters parameters)
Sets all parameters of this operator. The given parameters are not allowed to be null and must correspond to the parameter types defined by this operator.

Specified by:
setParameters in interface ConfigurationListener
Specified by:
setParameters in interface ParameterHandler

setParameter

public void setParameter(java.lang.String key,
                         java.lang.String value)
Sets the given single parameter to the Parameters object of this operator. For parameter list the method setListParameter(String, List) should be used.

Specified by:
setParameter in interface ParameterHandler

setListParameter

public void setListParameter(java.lang.String key,
                             java.util.List<java.lang.String[]> list)
Sets the given parameter list to the Parameters object of this operator. For single parameters the method setParameter(String, String) should be used.

Specified by:
setListParameter in interface ParameterHandler

getParameter

public java.lang.String getParameter(java.lang.String key)
                              throws UndefinedParameterError
Returns a single parameter retrieved from the Parameters of this Operator.

Specified by:
getParameter in interface ParameterHandler
Throws:
UndefinedParameterError

isParameterSet

public boolean isParameterSet(java.lang.String key)
                       throws UndefinedParameterError
Returns true iff the parameter with the given name is set.

Specified by:
isParameterSet in interface ParameterHandler
Throws:
UndefinedParameterError

getParameterAsString

public java.lang.String getParameterAsString(java.lang.String key)
                                      throws UndefinedParameterError
Returns a single named parameter and casts it to String.

Specified by:
getParameterAsString in interface ParameterHandler
Throws:
UndefinedParameterError

getParameterAsInt

public int getParameterAsInt(java.lang.String key)
                      throws UndefinedParameterError
Returns a single named parameter and casts it to int.

Specified by:
getParameterAsInt in interface ParameterHandler
Throws:
UndefinedParameterError

getParameterAsDouble

public double getParameterAsDouble(java.lang.String key)
                            throws UndefinedParameterError
Returns a single named parameter and casts it to double.

Specified by:
getParameterAsDouble in interface ParameterHandler
Throws:
UndefinedParameterError

getParameterAsBoolean

public boolean getParameterAsBoolean(java.lang.String key)
Returns a single named parameter and casts it to boolean. This method never throws an exception since there are no non-optional boolean parameters.

Specified by:
getParameterAsBoolean in interface ParameterHandler

getParameterList

public java.util.List<java.lang.String[]> getParameterList(java.lang.String key)
                                                    throws UndefinedParameterError
Returns a single named parameter and casts it to List. The list returned by this method contains the user defined key-value pairs. Each element is a String array of length 2. The first element is the key, the second the parameter value. The caller have to perform the casts to the correct types himself.

Specified by:
getParameterList in interface ParameterHandler
Throws:
UndefinedParameterError

getParameterAsColor

public java.awt.Color getParameterAsColor(java.lang.String key)
                                   throws UndefinedParameterError
Returns a single named parameter and casts it to Color.

Specified by:
getParameterAsColor in interface ParameterHandler
Throws:
UndefinedParameterError

getParameterAsInputStream

public java.io.InputStream getParameterAsInputStream(java.lang.String key)
                                              throws UndefinedParameterError,
                                                     java.io.IOException
Returns a single named parameter and tries to handle it as URL. If this works, this method creates an input stream from this URL and delivers it. If not, this method tries to cast the parameter value to a file. This file is already resolved against the process definition file. If the parameter name defines a non-optional parameter which is not set and has no default value, a UndefinedParameterError will be thrown. If the parameter is optional and was not set this method returns null. Operators should always use this method instead of directly using the method Process.resolveFileName(String).

Specified by:
getParameterAsInputStream in interface ParameterHandler
Throws:
UndefinedParameterError
java.io.IOException

getParameterAsFile

public java.io.File getParameterAsFile(java.lang.String key)
                                throws UndefinedParameterError
Returns a single named parameter and casts it to File. This file is already resolved against the process definition file but missing directories will not be created. If the parameter name defines a non-optional parameter which is not set and has no default value, a UndefinedParameterError will be thrown. If the parameter is optional and was not set this method returns null. Operators should always use this method instead of directly using the method Process.resolveFileName(String).

Specified by:
getParameterAsFile in interface ParameterHandler
Throws:
UndefinedParameterError

getParameterAsFile

public java.io.File getParameterAsFile(java.lang.String key,
                                       boolean createMissingDirectories)
                                throws UndefinedParameterError
Returns a single named parameter and casts it to File. This file is already resolved against the process definition file and missing directories will be created. If the parameter name defines a non-optional parameter which is not set and has no default value, a UndefinedParameterError will be thrown. If the parameter is optional and was not set this method returns null. Operators should always use this method instead of directly using the method Process.resolveFileName(String).

Specified by:
getParameterAsFile in interface ParameterHandler
Throws:
UndefinedParameterError

getParameterAsMatrix

public double[][] getParameterAsMatrix(java.lang.String key)
                                throws UndefinedParameterError
Returns a single named parameter and casts it to a double matrix.

Specified by:
getParameterAsMatrix in interface ParameterHandler
Throws:
UndefinedParameterError

getParameterTypes

public java.util.List<ParameterType> getParameterTypes()
Returns a list of ParameterTypes describing the parameters of this operator. The default implementation returns an empty list if no input objects can be retained and special parameters for those input objects which can be prevented from being consumed.

Specified by:
getParameterTypes in interface ParameterHandler

getParameterType

public ParameterType getParameterType(java.lang.String name)
Returns the parameter type with the given name. Will return null if this operator does not have a parameter with the given name.


writeXML

public void writeXML(java.io.PrintWriter out,
                     java.lang.String indent,
                     boolean hideDefault)
              throws java.io.IOException
Writes the XML representation of this operator.

Throws:
java.io.IOException

getXML

public java.lang.String getXML(java.lang.String indent,
                               boolean hideDefault)
Returns the XML representation of this operator.


getInnerOperatorsXML

protected java.lang.String getInnerOperatorsXML(java.lang.String indent,
                                                boolean hideDefault)
Writes the XML representation of the inner operators. Since an Operator does not have any inner operators, the default implementation does nothing. Implemented by OperatorChain.


createFromXML

public static Operator createFromXML(org.w3c.dom.Element element,
                                     java.util.List<UnknownParameterInformation> unknownParameterInformation)
                              throws XMLException
Throws:
XMLException

setOperatorParameters

public void setOperatorParameters(org.w3c.dom.Element element,
                                  java.util.List<UnknownParameterInformation> unknownParameterInformation)
                           throws XMLException
Sets all parameters of this operator (including inner operators and their parameters).

Throws:
XMLException

clearErrorList

public void clearErrorList()
Clears the list of errors.

See Also:
addError(String)

addError

public void addError(java.lang.String message)
Adds an error message.

See Also:
getErrorList()

addWarning

public void addWarning(java.lang.String message)
Adds a warning message to the error list.

See Also:
getErrorList()

getErrorList

public java.util.List<java.lang.String> getErrorList()
Returns a List of Strings containing error messages.

See Also:
addError(String)

getStartTime

public long getStartTime()
Returns the system time when the operator was started.


toString

public java.lang.String toString()
Returns the name.

Overrides:
toString in class java.lang.Object

createExperimentTree

@Deprecated
public java.lang.String createExperimentTree(int indent)
Deprecated. Use createProcessTree(int) instead

Returns this operator's name and class.


createProcessTree

public java.lang.String createProcessTree(int indent)
Returns this operator's name and class.


createMarkedExperimentTree

@Deprecated
public java.lang.String createMarkedExperimentTree(int indent,
                                                              java.lang.String mark,
                                                              Operator markOperator)
Deprecated. Use createMarkedProcessTree(int,String,Operator) instead

Returns this operator's name and class.


createMarkedProcessTree

public java.lang.String createMarkedProcessTree(int indent,
                                                java.lang.String mark,
                                                Operator markOperator)
Returns this operator's name and class.


createExperimentTree

@Deprecated
protected java.lang.String createExperimentTree(int indent,
                                                           java.lang.String selfPrefix,
                                                           java.lang.String childPrefix,
                                                           Operator markOperator,
                                                           java.lang.String mark)
Deprecated. Use createProcessTree(int,String,String,Operator,String) instead

Returns this operator's name and class.


createProcessTree

protected java.lang.String createProcessTree(int indent,
                                             java.lang.String selfPrefix,
                                             java.lang.String childPrefix,
                                             Operator markOperator,
                                             java.lang.String mark)
Returns this operator's name and class.


getEncoding

public final java.nio.charset.Charset getEncoding()
Returns the encoding if defined by the root operator if this operator is part of a process or the standard encoding defined via the system property. If both is not possible or if the defined encoding name is 'SYSTEM', the default encoding of the underlying operating system is returned.


isDebugMode

public boolean isDebugMode()

setApplyCount

public void setApplyCount(int applyCount)


Copyright © 2001-2009 by Rapid-I