|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.rapidminer.operator.Operator
com.rapidminer.operator.OperatorChain
public abstract class OperatorChain
A chain of operators that is subsequently applied. As an OperatorChain is an
Operator itself it can be arbitrarily nested.
Inheritants can access inner operators by getOperator(int). They
should override getMaxNumberOfInnerOperators() and
getMinNumberOfInnerOperators() which are used for some checks. They
should also override getInnerOperatorCondition() to ensure that all
inner operators get the desired input and return the necessary output for the
next inner operator. Please refer to the RapidMiner tutorial for a description how
to implement your own operator chain.
| Constructor Summary | |
|---|---|
OperatorChain(OperatorDescription description)
Creates an empty operator chain. |
|
| Method Summary | |
|---|---|
void |
addAddListener(AddListener listener)
Adds the given listener. |
int |
addOperator(Operator o)
Adds a new inner operator at the last position. |
int |
addOperator(Operator operator,
int index)
Adds the given operator at the given position. |
IOObject[] |
apply()
Applies all inner operators. |
int |
checkDeprecations()
Will count an the number of deprecated operators, i.e. the operators which Operator.getDeprecationInfo() method does not return null. |
java.lang.Class<?>[] |
checkIO(java.lang.Class<?>[] input)
This method checks if inner operators can handle their input and deliver the necessary output. |
int |
checkNumberOfInnerOperators()
Checks if the number of inner operators lies between MinInnerOps and MaxInnerOps. |
int |
checkProperties()
Will throw an exception if a non optional property has no default value and is not defined by user. |
void |
clearErrorList()
Clears the error list for this operator (by invoking the super method) and all children. |
Operator |
cloneOperator(java.lang.String name)
Performs a deep clone of this operator chain. |
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 |
protected java.lang.String |
createProcessTree(int indent,
java.lang.String selfPrefix,
java.lang.String childPrefix,
Operator markOperator,
java.lang.String mark)
Returns this OperatorChain's name and class and the process trees of the inner operators. |
java.util.List<Operator> |
getAllInnerOperators()
Returns recursively all child operators independently if they are activated or not. |
int |
getIndexOfOperator(Operator operator,
boolean useDisabled)
Returns the index of the given operator in the list of children. |
abstract InnerOperatorCondition |
getInnerOperatorCondition()
Must return a condition of the IO behaviour of all desired inner operators. |
Operator |
getInnerOperatorForName(java.lang.String name)
Returns the inner operator named name or null if no such operator exists. |
protected java.lang.String |
getInnerOperatorsXML(java.lang.String indent,
boolean hideDefault)
Returns the XML representation for all inner operators. |
abstract int |
getMaxNumberOfInnerOperators()
Returns the maximum number of inner operators. |
abstract int |
getMinNumberOfInnerOperators()
Returns the minimum number of inner operators. |
int |
getNumberOfAllOperators()
Returns the number of all inner operators (including the disabled operators). |
int |
getNumberOfOperators()
Returns the number of all enabled inner operators. |
Operator |
getOperator(int i)
Returns the i-th inner operator. |
Operator |
getOperatorFromAll(int i)
Returns the i-th operator. |
java.util.Iterator<Operator> |
getOperators()
Returns an iterator over all Operators. |
void |
performAdditionalChecks()
This method invokes the additional check method for each child. |
void |
processFinished()
Invokes the super method and the method for all children. |
void |
processStarts()
Invokes the super method and the method for all children. |
protected void |
registerOperator(Process process)
Register this operator chain and all of its children in the given process. |
void |
removeAddListener(AddListener listener)
Removes the given listener. |
protected void |
removeOperator(Operator operator)
Removes the given operator from this operator chain. |
protected boolean |
shouldAddNonConsumedInput()
|
protected boolean |
shouldReturnInnerOutput()
Indicates if inner output should be delivered by this operator chain. |
protected void |
unregisterOperator(Process process)
Unregisters this chain and all of its children from the given process. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public OperatorChain(OperatorDescription description)
| Method Detail |
|---|
public abstract int getMaxNumberOfInnerOperators()
public abstract int getMinNumberOfInnerOperators()
public abstract InnerOperatorCondition getInnerOperatorCondition()
SimpleChainInnerOperatorCondition. More than one
condition should be combined with help of the class
CombinedInnerOperatorCondition.
public void addAddListener(AddListener listener)
public void removeAddListener(AddListener listener)
public Operator cloneOperator(java.lang.String name)
cloneOperator in class Operator
public java.lang.Class<?>[] checkIO(java.lang.Class<?>[] input)
throws IllegalInputException,
WrongNumberOfInnerOperatorsException
shouldReturnInnerOutput() this method returns
getDeliveredOutputClasses() if the
output of the inner operators should not be returned.getAllOutputClasses(Class[] innerOutput)
if the output of the inner operators (innerOutput) should also be
returned.
checkIO in class OperatorIllegalInputException
WrongNumberOfInnerOperatorsExceptionprotected boolean shouldReturnInnerOutput()
Operator.getDeliveredOutputClasses() but of
getAllOutputClasses(Class[]).
protected boolean shouldAddNonConsumedInput()
public final int addOperator(Operator o)
public final int addOperator(Operator operator,
int index)
protected void registerOperator(Process process)
registerOperator in class Operatorprotected void unregisterOperator(Process process)
unregisterOperator in class Operatorprotected final void removeOperator(Operator operator)
public Operator getOperator(int i)
public java.util.Iterator<Operator> getOperators()
public java.util.List<Operator> getAllInnerOperators()
public int getNumberOfOperators()
public int getNumberOfAllOperators()
getNumberOfOperators().
public Operator getOperatorFromAll(int i)
getOperator(int i) this method also uses disabled operators.
Mainly used for GUI purposes. Other operators should use the method
getOperator(int i) which only delivers enabled inner operators.
public int getIndexOfOperator(Operator operator,
boolean useDisabled)
public Operator getInnerOperatorForName(java.lang.String name)
public void processStarts()
throws OperatorException
processStarts in class OperatorOperatorException
public void processFinished()
throws OperatorException
processFinished in class OperatorOperatorException
public IOObject[] apply()
throws OperatorException
apply in class OperatorOperatorException
public void performAdditionalChecks()
throws UserError
performAdditionalChecks in class OperatorUserErrorpublic int checkProperties()
checkProperties in class Operatorpublic int checkDeprecations()
Operator.getDeprecationInfo() method does not return null. Returns
the total number of deprecations.
checkDeprecations in class Operatorpublic int checkNumberOfInnerOperators()
@Deprecated
protected java.lang.String createExperimentTree(int indent,
java.lang.String selfPrefix,
java.lang.String childPrefix,
Operator markOperator,
java.lang.String mark)
createProcessTree(int,String,String,Operator,String) instead
createExperimentTree in class Operator
protected java.lang.String createProcessTree(int indent,
java.lang.String selfPrefix,
java.lang.String childPrefix,
Operator markOperator,
java.lang.String mark)
createProcessTree in class Operator
protected final java.lang.String getInnerOperatorsXML(java.lang.String indent,
boolean hideDefault)
getInnerOperatorsXML in class Operatorpublic void clearErrorList()
clearErrorList in class OperatorOperator.addError(String)
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||