Package org.xcsp.parser.entries
Class XVariables.XVar
- java.lang.Object
-
- org.xcsp.parser.entries.ParsingEntry
-
- org.xcsp.parser.entries.ParsingEntry.VEntry
-
- org.xcsp.parser.entries.XVariables.XVar
-
- All Implemented Interfaces:
IVar
- Direct Known Subclasses:
XVariables.XVarInteger
,XVariables.XVarReal
,XVariables.XVarSet
,XVariables.XVarStochastic
,XVariables.XVarSymbolic
- Enclosing class:
- XVariables
public abstract static class XVariables.XVar extends ParsingEntry.VEntry implements IVar
The class used to represent variables.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.xcsp.parser.entries.ParsingEntry
ParsingEntry.CEntry, ParsingEntry.OEntry, ParsingEntry.VEntry
-
Nested classes/interfaces inherited from interface org.xcsp.common.IVar
IVar.Var, IVar.VarSymbolic
-
-
Field Summary
Fields Modifier and Type Field Description int
degree
The degree of the variable.Domains.IDom
dom
The domain of the variable.-
Fields inherited from class org.xcsp.parser.entries.ParsingEntry.VEntry
type
-
Fields inherited from class org.xcsp.parser.entries.ParsingEntry
attributes, classes, flags, id, note
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
XVar(String id, Types.TypeVar type, Domains.IDom dom)
Builds a variable with the specified id, type and domain.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static XVariables.XVar
build(String id, Types.TypeVar type, Domains.IDom dom)
Builds a variable with the specified id, type and domain.static XVariables.XVar
build(String idArray, Types.TypeVar type, Domains.IDom dom, int[] indexes)
Builds a variable from an array with the specified id (combined with the specified indexes), type and domain.String
id()
Returns the id (unique name) of the variable.String
toString()
-
Methods inherited from class org.xcsp.parser.entries.ParsingEntry.VEntry
getType
-
Methods inherited from class org.xcsp.parser.entries.ParsingEntry
copyAttributesOf, getAttributeValue, getAttributeValue, getAttributeValue
-
-
-
-
Field Detail
-
dom
public final Domains.IDom dom
The domain of the variable. It is null if the variable is qualitative.
-
degree
public int degree
The degree of the variable. This is automatically computed after all constraints have been parsed.
-
-
Constructor Detail
-
XVar
protected XVar(String id, Types.TypeVar type, Domains.IDom dom)
Builds a variable with the specified id, type and domain.
-
-
Method Detail
-
build
public static final XVariables.XVar build(String id, Types.TypeVar type, Domains.IDom dom)
Builds a variable with the specified id, type and domain.
-
build
public static final XVariables.XVar build(String idArray, Types.TypeVar type, Domains.IDom dom, int[] indexes)
Builds a variable from an array with the specified id (combined with the specified indexes), type and domain.
-
id
public String id()
Description copied from interface:IVar
Returns the id (unique name) of the variable.
-
toString
public String toString()
- Overrides:
toString
in classParsingEntry.VEntry
-
-