org.drools.semantics.java
Class Interp

java.lang.Object
  |
  +--org.drools.semantics.java.Interp
Direct Known Subclasses:
BlockConsequence, Expr

public class Interp
extends java.lang.Object

Base class for BeanShell interpreter-based Java semantic components.

Version:
$Id: Interp.java,v 1.4 2002/08/19 00:31:42 bob Exp $
Author:
bob mcwhirter
See Also:
ExprCondition, ExprExtractor, BlockConsequence

Constructor Summary
protected Interp()
          Construct.
 
Method Summary
protected  void cleanUpInterpreter(Tuple tuple)
          Unconfigure the interpreter using a Tuple for variable bindings.
protected  java.lang.Object evaluate()
          Evaluate.
 java.lang.Object evaluate(Tuple tuple)
          Evaluate.
 java.lang.String getText()
          Retrieve the text to evaluate.
protected  void setText(java.lang.String text)
          Set the text to evaluate.
protected  void setUpInterpreter(Tuple tuple)
          Configure the interpreter using a Tuple for variable bindings.
protected  void setVariable(java.lang.String name, java.lang.Object value)
          Set a variable for the interpreter.
protected  void unsetVariable(java.lang.String name)
          Set a variable for the interpreter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Interp

protected Interp()
Construct.
Method Detail

evaluate

public java.lang.Object evaluate(Tuple tuple)
                          throws bsh.EvalError
Evaluate.
Parameters:
tuple - Tuple containing variable bindings.
Returns:
The result of evaluation.
Throws:
bsh.EvalError - If an error occurs while attempting to evaluate.

evaluate

protected java.lang.Object evaluate()
                             throws bsh.EvalError
Evaluate.
Returns:
The result of evaluation.
Throws:
bsh.EvalError - If an error occurs while attempting to evaluate.

getText

public java.lang.String getText()
Retrieve the text to evaluate.
Returns:
The text to evaluate.

setText

protected void setText(java.lang.String text)
Set the text to evaluate.
Parameters:
text - The text.

setUpInterpreter

protected void setUpInterpreter(Tuple tuple)
                         throws bsh.EvalError
Configure the interpreter using a Tuple for variable bindings.
Parameters:
tuple - Tuple containing variable bindings.
Throws:
bsh.EvalError - If an error occurs while attempting to bind variables.

setVariable

protected void setVariable(java.lang.String name,
                           java.lang.Object value)
                    throws bsh.EvalError
Set a variable for the interpreter.
Parameters:
name - The variable name.
value - The variable value.
Throws:
bsh.EvalError - If an error occurs while attempting to bind the variable.

cleanUpInterpreter

protected void cleanUpInterpreter(Tuple tuple)
                           throws bsh.EvalError
Unconfigure the interpreter using a Tuple for variable bindings.
Parameters:
tuple - Tuple containing variable bindings.
Throws:
bsh.EvalError - If an error occurs while attempting to unbind variables.

unsetVariable

protected void unsetVariable(java.lang.String name)
                      throws bsh.EvalError
Set a variable for the interpreter.
Parameters:
name - The variable name.
Throws:
bsh.EvalError - If an error occurs while attempting to unbind the variable.


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