/** * Negate this constraint. i.e equals becomes not equals. */ public void negate() { op = op.negate(); }
/** * Negate this constraint. i.e equals becomes not equals. */ public void negate() { op = op.negate(); }
/** * Return a new constraint set with each ConstraintOp negated. * @return A negated version of this constraint set. */ public ConstraintOptions negate() { ConstraintOp newMain = (mainSetOp == AND) ? OR : AND; ConstraintOp newRange = (rangeSetOp == AND) ? OR : AND; ConstraintOp newLeft = leftOp.negate(); ConstraintOp newRight = rightOp.negate(); return new ConstraintOptions( newMain, newRange, newLeft, newRight, leftField, rightField ); }
/** * Return a new constraint set with each ConstraintOp negated. * @return A negated version of this constraint set. */ public ConstraintOptions negate() { ConstraintOp newMain = (mainSetOp == AND) ? OR : AND; ConstraintOp newRange = (rangeSetOp == AND) ? OR : AND; ConstraintOp newLeft = leftOp.negate(); ConstraintOp newRight = rightOp.negate(); return new ConstraintOptions( newMain, newRange, newLeft, newRight, leftField, rightField ); }
/** * By default the CONTAINS options are same as the WITHIN options with the left and * right operators swapped. * @return The options that define what it means for the constrained object to CONTAIN * a given set of ranges. */ protected ConstraintOptions getContainsOptions() { ConstraintOptions withinOpts = getWithinOptions(); // by default the same as within, with right and left operations swapped. return new ConstraintOptions( withinOpts.getMainSetOp(), withinOpts.getRangeSetOp(), withinOpts.getLeftOp().negate(), withinOpts.getRightOp().negate(), withinOpts.getLeftField(), withinOpts.getRightField() ); }
/** * By default the CONTAINS options are same as the WITHIN options with the left and * right operators swapped. * @return The options that define what it means for the constrained object to CONTAIN * a given set of ranges. */ protected ConstraintOptions getContainsOptions() { ConstraintOptions withinOpts = getWithinOptions(); // by default the same as within, with right and left operations swapped. return new ConstraintOptions( withinOpts.getMainSetOp(), withinOpts.getRangeSetOp(), withinOpts.getLeftOp().negate(), withinOpts.getRightOp().negate(), withinOpts.getLeftField(), withinOpts.getRightField() ); }