/** * Construct a Constraint. Check that correct constraint op is selected for * single QueryEvaluable constructor * * @param qe1 first QueryEvaluable for comparison * @param op define op of comparison * @throws IllegalArgumentException if op does not correspond to a defined operation */ public SimpleConstraint(QueryEvaluable qe1, ConstraintOp op) { if (qe1 == null) { throw new NullPointerException("qe1 cannot be null"); } if (op == null) { throw new NullPointerException("op cannot be null"); } if (!validComparison(qe1.getType(), op, null)) { throw new IllegalArgumentException("Invalid constraint: " + qe1.getType().getName() + " " + op); } this.qe1 = qe1; this.op = op; }
/** * Construct a Constraint. Check that correct constraint op is selected for * single QueryEvaluable constructor * * @param qe1 first QueryEvaluable for comparison * @param op define op of comparison * @throws IllegalArgumentException if op does not correspond to a defined operation */ public SimpleConstraint(QueryEvaluable qe1, ConstraintOp op) { if (qe1 == null) { throw new NullPointerException("qe1 cannot be null"); } if (op == null) { throw new NullPointerException("op cannot be null"); } if (!validComparison(qe1.getType(), op, null)) { throw new IllegalArgumentException("Invalid constraint: " + qe1.getType().getName() + " " + op); } this.qe1 = qe1; this.op = op; }
qe2.youAreType(qe1.getType()); if (!validComparison(qe1.getType(), op, qe2.getType())) { throw new IllegalArgumentException("Invalid constraint: " + qe1 + " (a " + qe1.getType().getName() + ") " + op + " " + qe2 + " (a "
qe2.youAreType(qe1.getType()); if (!validComparison(qe1.getType(), op, qe2.getType())) { throw new IllegalArgumentException("Invalid constraint: " + qe1 + " (a " + qe1.getType().getName() + ") " + op + " " + qe2 + " (a "