org.drools.base
Class BaseEvaluator

java.lang.Object
  extended byorg.drools.base.BaseEvaluator
All Implemented Interfaces:
Evaluator, java.io.Serializable

public abstract class BaseEvaluator
extends java.lang.Object
implements Evaluator

BaseEvaluator is an Object Comparator that is operator aware

See Also:
Serialized Form
 

Field Summary
 
Fields inherited from interface org.drools.spi.Evaluator
ARRAY_TYPE, BOOLEAN_TYPE, BYTE_TYPE, CHAR_TYPE, CONTAINS, DATE_TYPE, DOUBLE_TYPE, EQUAL, EXCLUDES, FLOAT_TYPE, GREATER, GREATER_OR_EQUAL, INTEGER_TYPE, LESS, LESS_OR_EQUAL, LONG_TYPE, MATCHES, NOT_EQUAL, NULL_TYPE, OBJECT_TYPE, SHORT_TYPE, STRING_TYPE
 
Constructor Summary
BaseEvaluator(int type, int operator)
           
 
Method Summary
 boolean equals(java.lang.Object other)
           
abstract  boolean evaluate(java.lang.Object object1, java.lang.Object object2)
          This method will apply the evaluator on the objects.
 int getOperator()
           
 int getType()
           
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseEvaluator

public BaseEvaluator(int type,
                     int operator)
Method Detail

getOperator

public int getOperator()
Specified by:
getOperator in interface Evaluator

getType

public int getType()
Specified by:
getType in interface Evaluator

evaluate

public abstract boolean evaluate(java.lang.Object object1,
                                 java.lang.Object object2)
Description copied from interface: Evaluator
This method will apply the evaluator on the objects. Typically, they follow this form: Fact(object1 operator object2) Where operator selects the appropraite concrete evaluator, and object1, and object2 are parameters to this method. So Person(age < 42) will have object1==age field (of the Person fact object) and "42" will be the object2 value.

Specified by:
evaluate in interface Evaluator

equals

public boolean equals(java.lang.Object other)

hashCode

public int hashCode()