org.drools.semantics.python
Class Eval

java.lang.Object
  |
  +--org.drools.semantics.python.Interp
        |
        +--org.drools.semantics.python.Eval
Direct Known Subclasses:
ExprCondition, ExprExtractor

public class Eval
extends Interp

Base class for Jython expression-based Python semantic components.

Version:
$Id: Eval.java,v 1.6 2003/03/25 19:47:32 tdiesler Exp $
Author:
bob mcwhirter, Christiaan ten Klooster
See Also:
ExprCondition, ExprExtractor

Constructor Summary
protected Eval()
          Construct.
 
Method Summary
 void configure(java.lang.String text, Declaration[] availDecls)
          Configure.
protected  java.lang.Object evaluate()
          Evaluate.
protected  java.lang.Object evaluate(org.python.core.PyDictionary locals)
          Evaluate.
 java.lang.Object evaluate(Tuple tuple)
          Evaluate.
 java.lang.String getExpression()
          Return the expression.
 Declaration[] getRequiredTupleMembers()
          Retrieve the array of Declarations required by this condition to perform its duties.
 void setExpression(java.lang.String expr)
          Set the expression to evaluate.
 
Methods inherited from class org.drools.semantics.python.Interp
getCode, getNode, getText, setText, setUpDictionary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Eval

protected Eval()
Construct.
Method Detail

evaluate

public java.lang.Object evaluate(Tuple tuple)
Evaluate.
Parameters:
tuple - Tuple containing variable bindings.
Returns:
The result of evaluation.

evaluate

protected java.lang.Object evaluate(org.python.core.PyDictionary locals)
Evaluate.
Parameters:
locals - The evaluation dictionary.
Returns:
The result of evaluation.

evaluate

protected java.lang.Object evaluate()
Evaluate.
Returns:
The result of evaluation.

setExpression

public void setExpression(java.lang.String expr)
Set the expression to evaluate.
Parameters:
expr - The expression.

getExpression

public java.lang.String getExpression()
Return the expression.
Returns:
The expression.

getRequiredTupleMembers

public Declaration[] getRequiredTupleMembers()
Retrieve the array of Declarations required by this condition to perform its duties.
Returns:
The array of Declarations expected on incoming Tuples.

configure

public void configure(java.lang.String text,
                      Declaration[] availDecls)
               throws ConfigurationException
Configure.
Parameters:
text - Configuration text.
availDecls - Available declarations.
Throws:
ConfigurationException - If an error occurs while attempting to perform configuration.


Copyright © 2001-2003 The Werken Company. All Rights Reserved.