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.6 2002/08/26 23:04:34 bob Exp $
Author:
bob mcwhirter
See Also:
ExprCondition, ExprExtractor, BlockConsequence

Constructor Summary
protected Interp()
          Construct.
 
Method Summary
protected  java.lang.Object evaluate(bsh.NameSpace ns)
          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  bsh.NameSpace setUpNameSpace(Tuple tuple)
          Configure a NameSpace using a Tuple for variable bindings.
 
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(bsh.NameSpace ns)
                             throws bsh.EvalError
Evaluate.
Parameters:
ns - The evaluation namespace.
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.

setUpNameSpace

protected bsh.NameSpace setUpNameSpace(Tuple tuple)
                                throws bsh.EvalError
Configure a NameSpace using a Tuple for variable bindings.
Parameters:
tuple - Tuple containing variable bindings.
Returns:
The namespace
Throws:
bsh.EvalError - If an error occurs while attempting to bind variables.


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