Package org.projog.clp
Interface Expression
- All Known Subinterfaces:
Constraint,LeafExpression
- All Known Implementing Classes:
Absolute,Add,And,Between,Divide,EqualTo,Equivalent,FixedValue,Implication,LessThan,LessThanOrEqualTo,Maximum,Minimum,Minus,Multiply,Nand,Nor,Not,NotEqualTo,Or,Subtract,Variable,Xor
public interface Expression
Represents something that can have a range of numeric values.
Could be a single immutable value (see FixedValue), a variable that can have one or more possible values (see
Variable) or a composite that contains other Expression objects (e.g. Add).
-
Method Summary
Modifier and TypeMethodDescriptionlonggetMax(ReadConstraintStore constraintStore) longgetMin(ReadConstraintStore constraintStore) replace(Function<LeafExpression, LeafExpression> function) Returns aExpressionwithLeafExpressions in thisExpressionreplaced with values returned from the given function.setMax(ConstraintStore constraintStore, long max) setMin(ConstraintStore constraintStore, long min) default ExpressionResultsetNot(ConstraintStore store, long not) voidwalk(Consumer<Expression> consumer) Traverse this expression.
-
Method Details
-
getMin
-
getMax
-
setNot
-
setMin
-
setMax
-
walk
Traverse this expression.If this expression is a composite then all its sub-expressions will be traversed.
- Parameters:
consumer- will be called for eachExpressioncontained within thisExpression.
-
replace
Returns aExpressionwithLeafExpressions in thisExpressionreplaced with values returned from the given function.- Parameters:
function- returns theLeafExpressionto use as a replacement for theLeafExpressionit is called with, ornullif the originalLeafExpressionshould continue to be used.- Returns:
- a new
ExpressionwithLeafExpressions in thisExpressionreplaced with versions returned fromfunction.
-