private static boolean match ( Belief belief , AQuery query ) { assert ( belief != null ) ; assert ( query != null ) ; if ( belief . getBeliefset ( ) != query . getBeliefset ( ) ) { return false ; } switch ( query . getOp ( ) ) { case EQ : Object lhs = belief . getTuple ( ) [ query . getField ( ) ] ; Object rhs = query . getValue ( ) ; // Match wildcard or exact string return "*" . equals ( rhs ) || lhs . equals ( rhs ) ; case GT : // TODO: Handle Operator.GT case LT : // TODO: Handle Operator.LT default : break ; } return false ; }
Checks if the given query run on the given belief returns a match .