private ComplexExpr( String connector ) {
this.connector = connector;
}
public FieldConstraint asFieldConstraint( FactPattern factPattern ) {
CompositeFieldConstraint comp = new CompositeFieldConstraint();
comp.setCompositeJunctionType( connector.equals( "&&" ) ? CompositeFieldConstraint.COMPOSITE_TYPE_AND : CompositeFieldConstraint.COMPOSITE_TYPE_OR );
for ( Expr expr : subExprs ) {
comp.addConstraint( expr.asFieldConstraint( factPattern ) );
}
return comp;
}