@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
| Modifier and Type | Class and Description |
|---|---|
static class |
FlowByExpression.BracketNode
An expression node that encloses other expression nodes in brackets
|
static class |
FlowByExpression.ExpressionClause
An expression node that represents a clause of an expression
|
static class |
FlowByExpression.ExpressionNode
Abstract base class for parts of a boolean expression.
|
| Modifier and Type | Field and Description |
|---|---|
protected java.util.concurrent.atomic.AtomicInteger |
m_batchCount
Keep track of how many incoming batches we've seen
|
protected java.lang.String |
m_customNameOfFalseStep
Name of the step to receive instances that evaluate to false via the
expression
|
protected java.lang.String |
m_customNameOfTrueStep
Name of the step to receive instances that evaluate to true via the
expression
|
protected java.lang.String |
m_expressionString
The expression tree to use in internal textual format
|
protected Instances |
m_incomingStructure
Incoming structure
|
protected boolean |
m_isReset |
protected FlowByExpression.ExpressionNode |
m_root
The root of the expression tree
|
protected Data |
m_streamingData
Re-usable data object for streaming
|
protected boolean |
m_validFalseStep
True if the "false" step is valid (i.e. exists in the flow)
|
protected boolean |
m_validTrueStep
True if the "true" step is valid (i.e. exists in the flow)
|
m_stepIsResourceIntensive, m_stepManager, m_stepName| Constructor and Description |
|---|
FlowByExpression() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getCustomEditorForStep()
Return the fully qualified name of a custom editor component (JComponent)
to use for editing the properties of the step.
|
java.util.List<java.lang.String> |
getDownstreamStepNames()
Get a list of the names of connected downstream steps
|
java.lang.String |
getExpressionString()
Get the current expression (in internal format)
|
java.lang.String |
getFalseStepName()
Get the name of the connected step to send "false" instances to
|
java.util.List<java.lang.String> |
getIncomingConnectionTypes()
Get a list of incoming connection types that this step can accept.
|
java.util.List<java.lang.String> |
getOutgoingConnectionTypes()
Get a list of outgoing connection types that this step can produce.
|
java.lang.String |
getTrueStepName()
Get the name of the connected step to send "true" instances to
|
Instances |
outputStructureForConnectionType(java.lang.String connectionName)
If possible, get the output structure for the named connection type as a
header-only set of instances.
|
protected void |
processBatch(Data data)
Processes batch data (dataset, training or test) connections.
|
void |
processIncoming(Data data)
Main processing routine
|
protected void |
processStreaming(Data data)
Handles streaming "instance" connections
|
void |
setExpressionString(java.lang.String expressionString)
Set the expression (in internal format)
|
void |
setFalseStepName(java.lang.String falseStep)
Set the name of the connected step to send "false" instances to
|
void |
setTrueStepName(java.lang.String trueStep)
Set the name of the connected step to send "true" instances to
|
void |
stepInit()
Initialize the step.
|
environmentSubstitute, getDefaultSettings, getInteractiveViewers, getInteractiveViewersImpls, getName, getStepManager, globalInfo, isResourceIntensive, isStopRequested, setName, setStepIsResourceIntensive, setStepManager, setStepMustRunSingleThreaded, start, stepMustRunSingleThreaded, stopprotected boolean m_isReset
protected FlowByExpression.ExpressionNode m_root
protected java.lang.String m_expressionString
protected java.lang.String m_customNameOfTrueStep
protected java.lang.String m_customNameOfFalseStep
protected Instances m_incomingStructure
protected java.util.concurrent.atomic.AtomicInteger m_batchCount
protected boolean m_validTrueStep
protected boolean m_validFalseStep
protected Data m_streamingData
public void setExpressionString(java.lang.String expressionString)
expressionString - the expression to use (in internal format)public java.lang.String getExpressionString()
public void setTrueStepName(java.lang.String trueStep)
trueStep - the name of the step to send "true" instances topublic java.lang.String getTrueStepName()
public void setFalseStepName(java.lang.String falseStep)
falseStep - the name of the step to send "false" instances topublic java.lang.String getFalseStepName()
public java.util.List<java.lang.String> getDownstreamStepNames()
public void stepInit()
throws WekaException
WekaException - if a problem occurs during initializationpublic java.util.List<java.lang.String> getIncomingConnectionTypes()
public java.util.List<java.lang.String> getOutgoingConnectionTypes()
public Instances outputStructureForConnectionType(java.lang.String connectionName) throws WekaException
outputStructureForConnectionType in interface StepoutputStructureForConnectionType in class BaseStepconnectionName - the name of the connection type to get the output
structure forWekaException - if a problem occurspublic void processIncoming(Data data) throws WekaException
processIncoming in interface BaseStepExtenderprocessIncoming in interface StepprocessIncoming in class BaseStepdata - incoming data objectWekaException - if a problem occursprotected void processStreaming(Data data) throws WekaException
data - incoming data object encapsulating an instance to processWekaException - if a problem occursprotected void processBatch(Data data) throws WekaException
data - the data object to processWekaException - if a problem occurspublic java.lang.String getCustomEditorForStep()
getCustomEditorForStep in interface StepgetCustomEditorForStep in class BaseStep