Class DefaultConstraint
- java.lang.Object
-
- net.ssehub.easy.varModel.model.ModelElement
-
- net.ssehub.easy.varModel.model.ContainableModelElement
-
- net.ssehub.easy.varModel.model.Constraint
-
- net.ssehub.easy.reasoning.core.reasoner.DefaultConstraint
-
- All Implemented Interfaces:
IDatatypeVisitable,IModelElement,IPartialEvaluable
public class DefaultConstraint extends Constraint
Reasoner specific constraint type indicating aConstraint.Type.DEFAULTconstraint. This shall avoid requiring an attribute for this purpose for all constraints and using it just for temporary reasoning ones.- Author:
- Holger Eichelberger
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.ssehub.easy.varModel.model.Constraint
Constraint.IConstraintType, Constraint.Type
-
-
Field Summary
Fields Modifier and Type Field Description private ConstraintListdefaultConstraintsprivate ConstraintListdeferredDefaultConstraints
-
Constructor Summary
Constructors Constructor Description DefaultConstraint(ConstraintSyntaxTree consSyntax, IModelElement parent)Creates a new constraint from an already parsed syntax tree.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConstraintcreateConstraint(ConstraintSyntaxTree consSyntax)Creates a new constraint with same properties but changed constraint syntax tree.intgetAttachedConstraintsSize()Returns the number of attached constraints.ConstraintListgetDefaultConstraints()Returns the default constraint list explicitly.ConstraintListgetDeferredDefaultConstraints()Returns the deferred default constraint list explicitly.Constraint.IConstraintTypegetType()Returns the conceptual type of the constraint.voidsetDefaultConstraints(ConstraintList defaultConstraints)Sets the default constraint list explicitly.voidsetDeferredDefaultConstraints(ConstraintList deferredDefaultConstraints)Sets the deferred default constraint list explicitly.-
Methods inherited from class net.ssehub.easy.varModel.model.Constraint
accept, getAttachedTo, getConsSyntax, isBooleanConstraint, setConsSyntax, toString
-
Methods inherited from class net.ssehub.easy.varModel.model.ContainableModelElement
accept, getNameSpace, getParent, getProject, getQualifiedName, getTopLevelParent, isTopLevel, setParent
-
Methods inherited from class net.ssehub.easy.varModel.model.ModelElement
findAttribute, getComment, getName, getUniqueName, isTransparent, propagateAttribute, setComment, setName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.ssehub.easy.varModel.model.IPartialEvaluable
getParent
-
-
-
-
Field Detail
-
defaultConstraints
private ConstraintList defaultConstraints
-
deferredDefaultConstraints
private ConstraintList deferredDefaultConstraints
-
-
Constructor Detail
-
DefaultConstraint
public DefaultConstraint(ConstraintSyntaxTree consSyntax, IModelElement parent) throws CSTSemanticException
Creates a new constraint from an already parsed syntax tree.- Parameters:
consSyntax- the constraint syntax treeparent- the object, in which this specific one is embedded- Throws:
CSTSemanticException- in case that the constraint semantics cannot be resolved or that the specified constraint does not evaluate to a boolean expression
-
-
Method Detail
-
setDefaultConstraints
public void setDefaultConstraints(ConstraintList defaultConstraints)
Sets the default constraint list explicitly. Default constraints can be evaluated directly without further constraint/variable dependencies. The attached constraints are temporary.- Parameters:
defaultConstraints- the default constraints, may be null for none
-
setDeferredDefaultConstraints
public void setDeferredDefaultConstraints(ConstraintList deferredDefaultConstraints)
Sets the deferred default constraint list explicitly. Default constraints have dependencies and shall be evaluated (initially) after the default constraints. The attached constraints are temporary.- Parameters:
deferredDefaultConstraints- the deferred default constraints, may be null for none
-
getDefaultConstraints
public ConstraintList getDefaultConstraints()
Returns the default constraint list explicitly. Default constraints can be evaluated directly without further constraint/variable dependencies. The attached constraints are temporary.- Returns:
- the default constraints, may be null for none
-
getDeferredDefaultConstraints
public ConstraintList getDeferredDefaultConstraints()
Returns the deferred default constraint list explicitly. Default constraints have dependencies and shall be evaluated (initially) after the default constraints. The attached constraints are temporary.- Returns:
- the deferred default constraints, may be null for none
-
getAttachedConstraintsSize
public int getAttachedConstraintsSize()
Returns the number of attached constraints. The attached constraints are temporary.- Returns:
- the number of attached constraints
-
getType
public Constraint.IConstraintType getType()
Returns the conceptual type of the constraint.- Overrides:
getTypein classConstraint- Returns:
- the conceptual type (
Constraint.Type.DEFAULT)
-
createConstraint
public Constraint createConstraint(ConstraintSyntaxTree consSyntax) throws CSTSemanticException
Description copied from class:ConstraintCreates a new constraint with same properties but changed constraint syntax tree.- Overrides:
createConstraintin classConstraint- Parameters:
consSyntax- the syntax tree- Returns:
- the new constraint
- Throws:
CSTSemanticException- in case that the constraint semantics cannot be resolved or that the specified constraint does not evaluate to a boolean expression
-
-