Package org.projog.clp.bool
Class Xor
- java.lang.Object
-
- org.projog.clp.bool.Xor
-
- All Implemented Interfaces:
Constraint
public final class Xor extends java.lang.Object implements Constraint
-
-
Field Summary
Fields Modifier and Type Field Description private Constraintleftprivate Constraintright
-
Constructor Summary
Constructors Constructor Description Xor(Constraint left, Constraint right)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ConstraintResultenforce(ConstraintStore constraintStore)Attempts to enforce this constraint using the givenConstraintStore.private static ConstraintResultenforce(ConstraintStore constraintStore, Constraint a, Constraint b)ConstraintResultprevent(ConstraintStore constraintStore)Attempts to prevent this constraint using the givenConstraintStore.ConstraintResultreify(ReadConstraintStore constraintStore)Xorreplace(java.util.function.Function<LeafExpression,LeafExpression> r)Returns newConstraintwithLeafExpressions in thisConstraintreplaced with values returned from the given function.java.lang.StringtoString()voidwalk(java.util.function.Consumer<Expression> r)Traverse this constraint.
-
-
-
Field Detail
-
left
private final Constraint left
-
right
private final Constraint right
-
-
Constructor Detail
-
Xor
public Xor(Constraint left, Constraint right)
-
-
Method Detail
-
enforce
public ConstraintResult enforce(ConstraintStore constraintStore)
Description copied from interface:ConstraintAttempts to enforce this constraint using the givenConstraintStore.- Specified by:
enforcein interfaceConstraint
-
enforce
private static ConstraintResult enforce(ConstraintStore constraintStore, Constraint a, Constraint b)
-
reify
public ConstraintResult reify(ReadConstraintStore constraintStore)
- Specified by:
reifyin interfaceConstraint
-
prevent
public ConstraintResult prevent(ConstraintStore constraintStore)
Description copied from interface:ConstraintAttempts to prevent this constraint using the givenConstraintStore.- Specified by:
preventin interfaceConstraint
-
walk
public void walk(java.util.function.Consumer<Expression> r)
Description copied from interface:ConstraintTraverse this constraint.- Specified by:
walkin interfaceConstraint- Parameters:
r- will be called for eachExpressioncontained within thisConstraint.
-
replace
public Xor replace(java.util.function.Function<LeafExpression,LeafExpression> r)
Description copied from interface:ConstraintReturns newConstraintwithLeafExpressions in thisConstraintreplaced with values returned from the given function.- Specified by:
replacein interfaceConstraint- Parameters:
r- returns theLeafExpressionto use as a replacement for theLeafExpressionit is called with, ornullif the originalLeafExpressionshould continue to be used.- Returns:
- a new
ConstraintwithLeafExpressions in thisConstraintreplaced with versions returned fromfunction.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-