Package weka.knowledgeflow.steps
Class FlowByExpression
java.lang.Object
weka.knowledgeflow.steps.BaseStep
weka.knowledgeflow.steps.FlowByExpression
- All Implemented Interfaces:
Serializable
,BaseStepExtender
,Step
@KFStep(name="FlowByExpression",
category="Flow",
toolTipText="Route instances according to the evaluation of a logical expression. The expression can test the values of one or more incoming attributes. The test can involve constants or comparing one attribute\'s values to another. Inequalities along with string operations such as contains, starts-with, ends-with and regular expressions may be used as operators. \"True\" instances can be sent to one downstream step and \"False\" instances sent to another.",
iconPath="weka/gui/knowledgeflow/icons/FlowByExpression.png")
public class FlowByExpression
extends BaseStep
A step that splits incoming instances (or instance streams) according to the
evaluation of a logical expression. The expression can test the values of one
or more incoming attributes. The test can involve constants or comparing one
attribute's values to another. Inequalities along with string operations such
as contains, starts-with, ends-with and regular expressions may be used as
operators.
- Version:
- $Revision: $
- Author:
- Mark Hall (mhall{[at]}pentaho{[dot]}com)
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
An expression node that encloses other expression nodes in bracketsstatic class
An expression node that represents a clause of an expressionstatic class
Abstract base class for parts of a boolean expression. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturn the fully qualified name of a custom editor component (JComponent) to use for editing the properties of the step.Get a list of the names of connected downstream stepsGet the current expression (in internal format)Get the name of the connected step to send "false" instances toGet a list of incoming connection types that this step can accept.Get a list of outgoing connection types that this step can produce.Get the name of the connected step to send "true" instances tooutputStructureForConnectionType
(String connectionName) If possible, get the output structure for the named connection type as a header-only set of instances.void
processIncoming
(Data data) Main processing routinevoid
setExpressionString
(String expressionString) Set the expression (in internal format)void
setFalseStepName
(String falseStep) Set the name of the connected step to send "false" instances tovoid
setTrueStepName
(String trueStep) Set the name of the connected step to send "true" instances tovoid
stepInit()
Initialize the step.Methods inherited from class weka.knowledgeflow.steps.BaseStep
environmentSubstitute, getDefaultSettings, getInteractiveViewers, getInteractiveViewersImpls, getName, getStepManager, globalInfo, isResourceIntensive, isStopRequested, outputStructureForConnectionType, setName, setStepIsResourceIntensive, setStepManager, setStepMustRunSingleThreaded, start, stepMustRunSingleThreaded, stop
-
Constructor Details
-
FlowByExpression
public FlowByExpression()
-
-
Method Details
-
setExpressionString
Set the expression (in internal format)- Parameters:
expressionString
- the expression to use (in internal format)
-
getExpressionString
Get the current expression (in internal format)- Returns:
- the current expression (in internal format)
-
setTrueStepName
Set the name of the connected step to send "true" instances to- Parameters:
trueStep
- the name of the step to send "true" instances to
-
getTrueStepName
Get the name of the connected step to send "true" instances to- Returns:
- the name of the step to send "true" instances to
-
setFalseStepName
Set the name of the connected step to send "false" instances to- Parameters:
falseStep
- the name of the step to send "false" instances to
-
getFalseStepName
Get the name of the connected step to send "false" instances to- Returns:
- the name of the step to send "false" instances to
-
getDownstreamStepNames
Get a list of the names of connected downstream steps- Returns:
- a list of the names of connected downstream steps
-
stepInit
Initialize the step.- Throws:
WekaException
- if a problem occurs during initialization
-
getIncomingConnectionTypes
Get a list of incoming connection types that this step can accept. Ideally (and if appropriate), this should take into account the state of the step and any existing incoming connections. E.g. a step might be able to accept one (and only one) incoming batch data connection.- Returns:
- a list of incoming connections that this step can accept given its current state
-
getOutgoingConnectionTypes
Get a list of outgoing connection types that this step can produce. Ideally (and if appropriate), this should take into account the state of the step and the incoming connections. E.g. depending on what incoming connection is present, a step might be able to produce a trainingSet output, a testSet output or neither, but not both.- Returns:
- a list of outgoing connections that this step can produce
-
outputStructureForConnectionType
If possible, get the output structure for the named connection type as a header-only set of instances. Can return null if the specified connection type is not representable as Instances or cannot be determined at present.- Specified by:
outputStructureForConnectionType
in interfaceStep
- Overrides:
outputStructureForConnectionType
in classBaseStep
- Parameters:
connectionName
- the name of the connection type to get the output structure for- Returns:
- the output structure as a header-only Instances object
- Throws:
WekaException
- if a problem occurs
-
processIncoming
Main processing routine- Specified by:
processIncoming
in interfaceBaseStepExtender
- Specified by:
processIncoming
in interfaceStep
- Overrides:
processIncoming
in classBaseStep
- Parameters:
data
- incoming data object- Throws:
WekaException
- if a problem occurs
-
getCustomEditorForStep
Return the fully qualified name of a custom editor component (JComponent) to use for editing the properties of the step. This method can return null, in which case the system will dynamically generate an editor using the GenericObjectEditor- Specified by:
getCustomEditorForStep
in interfaceStep
- Overrides:
getCustomEditorForStep
in classBaseStep
- Returns:
- the fully qualified name of a step editor component
-