org.drools.spi
Interface Condition

All Superinterfaces:
SemanticComponent, java.io.Serializable
All Known Implementing Classes:
ExprCondition, ExprCondition, ExprCondition

public interface Condition
extends SemanticComponent

A Condition that filters facts.

Version:
$Id: Condition.java,v 1.9 2003/11/19 21:31:12 bob Exp $
Author:
bob mcwhirter
See Also:
Tuple

Field Summary
static Condition[] EMPTY_ARRAY
          Empty Condition array.
 
Method Summary
 Declaration[] getRequiredTupleMembers()
          Retrieve the array of Declarations required by this condition to perform its duties.
 boolean isAllowed(Tuple tuple)
          Determine if the supplied Tuple is allowed by this condition.
 

Field Detail

EMPTY_ARRAY

public static final Condition[] EMPTY_ARRAY
Empty Condition array.

Method Detail

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.

isAllowed

public boolean isAllowed(Tuple tuple)
                  throws ConditionException
Determine if the supplied Tuple is allowed by this 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.