Package org.xcsp.common
Interface Condition
-
- All Known Implementing Classes:
Condition.ConditionIntset
,Condition.ConditionIntvl
,Condition.ConditionPar
,Condition.ConditionRel
,Condition.ConditionSet
,Condition.ConditionVal
,Condition.ConditionVar
public interface Condition
The root interface for denoting a condition, i.e., a pair (operator,operand) used in many XCSP3 constraints.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Condition.ConditionIntset
Represents a condition composed of a set operator and an array of values (int) as (right) operand.static class
Condition.ConditionIntvl
Represents a condition composed of a set operator and an interval (defined by its two inclusive bounds) as (right) operand.static class
Condition.ConditionPar
static class
Condition.ConditionRel
Represents a condition based on a relational operator.static class
Condition.ConditionSet
Represents a condition based on a set operator.static class
Condition.ConditionVal
Represents a condition composed of a relational operator and a value (long integer) as (right) operand.static class
Condition.ConditionVar
Represents a condition composed of a relational operator and a variable as operand.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static Condition
buildFrom(Object operator, Object limit)
Returns an object instance of a class implementingCondition
, built from the specified arguments.default int[]
filtering(int[] values)
default IVar
involvedVar()
Returns the variable involved in the condition, if one is present,null
otherwise.Types.TypeExpr
operatorTypeExpr()
Object
rightTerm()
static XNodeParent<? extends IVar>
toNode(IVar x, Condition condition)
-
-
-
Method Detail
-
buildFrom
static Condition buildFrom(Object operator, Object limit)
Returns an object instance of a class implementingCondition
, built from the specified arguments.- Parameters:
operator
- a relational operatorTypeConditionOperatorRel
, a set operatorTypeConditionOperatorSet
or a more general objectTypeConditionOperator
limit
- an integer (objectNumber
), a variable (objectIVar
), a range (objectRange
) or a 1-dimensional array ofint
- Returns:
- an object instance of a class implementing
Condition
, built from the specified arguments
-
toNode
static XNodeParent<? extends IVar> toNode(IVar x, Condition condition)
-
involvedVar
default IVar involvedVar()
Returns the variable involved in the condition, if one is present,null
otherwise.- Returns:
- the variable involved in the condition, if one is present,
null
otherwise
-
operatorTypeExpr
Types.TypeExpr operatorTypeExpr()
-
rightTerm
Object rightTerm()
-
filtering
default int[] filtering(int[] values)
-
-