Package org.xcsp.parser.entries
Class XConstraints.XCtr
- java.lang.Object
-
- org.xcsp.parser.entries.ParsingEntry
-
- org.xcsp.parser.entries.ParsingEntry.CEntry
-
- org.xcsp.parser.entries.XConstraints.CEntryReifiable
-
- org.xcsp.parser.entries.XConstraints.XCtr
-
- Enclosing class:
- XConstraints
public static class XConstraints.XCtr extends XConstraints.CEntryReifiable
The class for representing a stand-alone constraint, or a constraint template.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.xcsp.parser.entries.ParsingEntry
ParsingEntry.CEntry, ParsingEntry.OEntry, ParsingEntry.VEntry
-
-
Field Summary
Fields Modifier and Type Field Description XConstraints.XAbstraction
abstraction
The object for handling abstraction.XConstraints.CChild[]
childs
The child elements of the constraint.Types.TypeCtr
type
The type of the constraint.-
Fields inherited from class org.xcsp.parser.entries.XConstraints.CEntryReifiable
reification, softening
-
Fields inherited from class org.xcsp.parser.entries.ParsingEntry
attributes, classes, flags, id, note
-
-
Constructor Summary
Constructors Constructor Description XCtr(Types.TypeCtr type, XConstraints.CChild... childs)
Build an object representing a stand-alone constraint (template).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LinkedHashSet<XVariables.XVar>
collectVars(LinkedHashSet<XVariables.XVar> set)
Collect the set of variables involved in this element, and add them to the specified set.Types.TypeCtr
getType()
Returns the type of the constraint.boolean
subjectToAbstraction()
Returns true iff this element is subject to abstraction, i.e., contains parameters (tokens of the form %i or %...).String
toString()
-
Methods inherited from class org.xcsp.parser.entries.ParsingEntry.CEntry
vars
-
Methods inherited from class org.xcsp.parser.entries.ParsingEntry
copyAttributesOf, getAttributeValue, getAttributeValue, getAttributeValue
-
-
-
-
Field Detail
-
type
public final Types.TypeCtr type
The type of the constraint. For example, it may be intension, extension, or regular.
-
childs
public final XConstraints.CChild[] childs
The child elements of the constraint. For example, we have a first child for- and a second child for
if the constraint is .
-
abstraction
public XConstraints.XAbstraction abstraction
The object for handling abstraction. Of course, it is null if the constraint is not abstract, i.e., is not a constraint template.
-
-
Constructor Detail
-
XCtr
public XCtr(Types.TypeCtr type, XConstraints.CChild... childs)
Build an object representing a stand-alone constraint (template).
-
-
Method Detail
-
getType
public final Types.TypeCtr getType()
Returns the type of the constraint. For example, it may be intension, extension, or regular. We need an accessor for Scala.
-
collectVars
public LinkedHashSet<XVariables.XVar> collectVars(LinkedHashSet<XVariables.XVar> set)
Description copied from class:ParsingEntry.CEntry
Collect the set of variables involved in this element, and add them to the specified set.- Overrides:
collectVars
in classXConstraints.CEntryReifiable
-
subjectToAbstraction
public boolean subjectToAbstraction()
Description copied from class:ParsingEntry.CEntry
Returns true iff this element is subject to abstraction, i.e., contains parameters (tokens of the form %i or %...).- Specified by:
subjectToAbstraction
in classParsingEntry.CEntry
-
toString
public String toString()
- Overrides:
toString
in classXConstraints.CEntryReifiable
-
-