org.drools.semantics.java
Class JavaCondition

java.lang.Object
  extended by org.drools.semantics.java.JavaCondition
All Implemented Interfaces:
Serializable, Condition, SemanticComponent

public class JavaCondition
extends Object
implements Serializable, Condition

Java expression semantics Condition.

Author:
bob@werken.com
See Also:
Serialized Form

Nested Class Summary
static interface JavaCondition.Script
           
 
Constructor Summary
protected JavaCondition(Rule rule, int id, String expression)
          Construct.
 
Method Summary
 boolean equals(Object object)
           
 Declaration[] getRequiredTupleMembers()
          Retrieve the Declaration s required for evaluating the expression.
 int hashCode()
           
 boolean isAllowed(Tuple tuple)
          Determine if the supplied Tuple is allowed by this condition.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JavaCondition

protected JavaCondition(Rule rule,
                        int id,
                        String expression)
                 throws Exception
Construct.

Parameters:
expression - The expression.
rule - The rule.
Throws:
ConfigurationException - If an error occurs while attempting to perform configuration.
Exception
Method Detail

isAllowed

public boolean isAllowed(Tuple tuple)
                  throws ConditionException
Determine if the supplied Tuple is allowed by this condition.

Specified by:
isAllowed in interface Condition
Parameters:
tuple - The Tuple to test.
Returns:
true if the Tuple passes this condition, else false.
Throws:
ConditionException - if an error occurs during filtering.

getRequiredTupleMembers

public Declaration[] getRequiredTupleMembers()
Retrieve the Declaration s required for evaluating the expression.

Specified by:
getRequiredTupleMembers in interface Condition
Returns:
The required declarations.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object object)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2001-2005 The Codehaus. All Rights Reserved.