Package org.xcsp.parser.entries
Class XConstraints.CChild
- java.lang.Object
-
- org.xcsp.parser.entries.ParsingEntry
-
- org.xcsp.parser.entries.ParsingEntry.CEntry
-
- org.xcsp.parser.entries.XConstraints.CChild
-
- Enclosing class:
- XConstraints
public static final class XConstraints.CChild extends ParsingEntry.CEntry
The class for representing a child element of a constraint (or constraint template). For example, it is used to represent an element- or an element
.
-
-
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 Types.TypeChild
type
The type of the child.Object
value
The value of the child.-
Fields inherited from class org.xcsp.parser.entries.ParsingEntry
attributes, classes, flags, id, note
-
-
Constructor Summary
Constructors Constructor Description CChild(Types.TypeChild type, Object value)
Build an object representing a child element of a 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.TypeChild
getType()
Returns the type of the child.boolean
isTotallyAbstract()
Returns true iff the value of the child only contains parameters (tokens of the form %i or %...).boolean
setVariableInvolved()
Returns true iff a set variable is involved in the (value field of the) element.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.TypeChild type
The type of the child. For example list, supports, or transitions.
-
value
public Object value
The value of the child. It is actually the parsed textual content of the child. After parsing, it may be a variable, an integer, an array of variables, a condition, an array of parameters ...
-
-
Constructor Detail
-
CChild
public CChild(Types.TypeChild type, Object value)
Build an object representing a child element of a constraint (template). The specified type corresponds to the tag name of the child, and the value corresponds to the parsed textual content of the child.
-
-
Method Detail
-
getType
public final Types.TypeChild getType()
Returns the type of the child. For example list, supports, or transitions. We need an accessor for Scala.
-
setVariableInvolved
public boolean setVariableInvolved()
Returns true iff a set variable is involved in the (value field of the) element.
-
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.- Specified by:
collectVars
in classParsingEntry.CEntry
-
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
-
isTotallyAbstract
public boolean isTotallyAbstract()
Returns true iff the value of the child only contains parameters (tokens of the form %i or %...).
-
toString
public String toString()
- Overrides:
toString
in classParsingEntry.CEntry
-
-