public class ExpressionFilter extends ExpressionOperation implements cascading.operation.Filter<ScriptOperation.Context>
Tuple
values. Any Tuple that
returns true for the given expression will be removed from the stream. This Filter
is based on the Janino compiler.
Specifically this filter uses the ExpressionEvaluator
, thus the syntax from that class is inherited here.
An expression may use field names directly as parameters in the expression, or field positions with the syntax
"$n", where n is an integer.
Given an argument tuple with the fields "a" and "b", the following expression returns true: a + b == $0 + $1
ScriptOperation.Context
block, parameterNames, parameterTypes, returnType
Constructor and Description |
---|
ExpressionFilter(java.lang.String expression)
Constructor ExpressionFilter creates a new ExpressionFilter instance.
|
ExpressionFilter(java.lang.String expression,
java.lang.Class parameterType)
Constructor ExpressionFilter creates a new ExpressionFilter instance.
|
ExpressionFilter(java.lang.String expression,
java.lang.String[] parameterNames,
java.lang.Class[] parameterTypes)
Constructor ExpressionFilter creates a new ExpressionFilter instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isRemove(cascading.flow.FlowProcess flowProcess,
cascading.operation.FilterCall<ScriptOperation.Context> filterCall) |
getEvaluator, getExpression, guessParameterNames
equals, evaluate, getBlock, getParameterNames, getParameterTypes, getReturnType, hashCode, prepare
cleanup, flush, getFieldDeclaration, getNumArgs, getTrace, isSafe, printOperationInternal, toString, toStringInternal
@ConstructorProperties(value="expression") public ExpressionFilter(java.lang.String expression)
a + b
. The type of a
and b
will be inherited from the incoming argument fields.
Or, if the incoming argument selector is Fields.NONE
, an expression using only static method calls
or constants can be used, for example Math.random() < SomeClass.someValue()
.expression
- of type String@ConstructorProperties(value={"expression","parameterType"}) public ExpressionFilter(java.lang.String expression, java.lang.Class parameterType)
expression
- of type StringparameterType
- of type Class@ConstructorProperties(value={"expression","parameterNames","parameterTypes"}) public ExpressionFilter(java.lang.String expression, java.lang.String[] parameterNames, java.lang.Class[] parameterTypes)
expression
- of type StringparameterNames
- of type String[]parameterTypes
- of type Class[]public boolean isRemove(cascading.flow.FlowProcess flowProcess, cascading.operation.FilterCall<ScriptOperation.Context> filterCall)
isRemove
in interface cascading.operation.Filter<ScriptOperation.Context>
Copyright © 2007-2015 Xplenty, Inc. All Rights Reserved.