org.shapelogic.scripting
Class FunctionPredicate<In>

java.lang.Object
  extended by org.shapelogic.scripting.BaseScriptingFunction
      extended by org.shapelogic.scripting.FunctionPredicate<In>
All Implemented Interfaces:
Calc1<In,java.lang.Object>, Predicate<In>

public class FunctionPredicate<In>
extends BaseScriptingFunction
implements Predicate<In>, Calc1<In,java.lang.Object>

Transform based on an expression in a Scripting language using JSR 223. Requires Groovy to be installed. Need special installation of groovy-engine.jar that need to be downloade from Sun. Requires that the scripting language support the invocable interface.

Author:
Sami Badawi

Field Summary
 
Fields inherited from class org.shapelogic.scripting.BaseScriptingFunction
_expression, _functionName, _language, _scriptEngine, DEFAULT_LANGUAGE
 
Constructor Summary
FunctionPredicate(java.lang.String name, java.lang.String expression)
           
FunctionPredicate(java.lang.String functionName, java.lang.String expression, java.lang.String language)
           
 
Method Summary
 boolean evaluate(In input)
          Checks if a binary predicate relation holds.
 java.lang.Object invoke(In input)
           
static
<In0,In1,In2>
Predicate<In0>
makeFunctionPredicate(java.lang.String expression, BinaryPredicate<In1,In2> binaryPredicate, In2 compareObject, java.lang.String language, java.lang.String functionName)
           
static
<In0,In1,In2>
Predicate<In0>
makeFunctionPredicate(java.lang.String expression, java.lang.String binaryPredicateString, In2 compareObject, java.lang.String language, java.lang.String functionName)
           
 
Methods inherited from class org.shapelogic.scripting.BaseScriptingFunction
getScriptEngine, put
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FunctionPredicate

public FunctionPredicate(java.lang.String functionName,
                         java.lang.String expression,
                         java.lang.String language)

FunctionPredicate

public FunctionPredicate(java.lang.String name,
                         java.lang.String expression)
Method Detail

invoke

public java.lang.Object invoke(In input)
Specified by:
invoke in interface Calc1<In,java.lang.Object>

evaluate

public boolean evaluate(In input)
Description copied from interface: Predicate
Checks if a binary predicate relation holds.

Specified by:
evaluate in interface Predicate<In>

makeFunctionPredicate

public static <In0,In1,In2> Predicate<In0> makeFunctionPredicate(java.lang.String expression,
                                                                 BinaryPredicate<In1,In2> binaryPredicate,
                                                                 In2 compareObject,
                                                                 java.lang.String language,
                                                                 java.lang.String functionName)

makeFunctionPredicate

public static <In0,In1,In2> Predicate<In0> makeFunctionPredicate(java.lang.String expression,
                                                                 java.lang.String binaryPredicateString,
                                                                 In2 compareObject,
                                                                 java.lang.String language,
                                                                 java.lang.String functionName)


Copyright © 2009. All Rights Reserved.