Package net.ssehub.easy.varModel.model
Class DecisionVariableDeclaration
java.lang.Object
net.ssehub.easy.varModel.model.ModelElement
net.ssehub.easy.varModel.model.ContainableModelElement
net.ssehub.easy.varModel.model.AbstractVariable
net.ssehub.easy.varModel.model.DecisionVariableDeclaration
- All Implemented Interfaces:
net.ssehub.easy.basics.modelManagement.IVariable,IDatatypeVisitable,IDerivedDatatypeListener,IAttributableElement,IAttributeAccess,IFreezable,IModelElement
- Direct Known Subclasses:
ConstantDecisionVariableDeclaration,ExplicitTypeVariableDeclaration,ProjectDecisionVariableDeclaration
public class DecisionVariableDeclaration
extends AbstractVariable
implements IFreezable, IAttributableElement, net.ssehub.easy.basics.modelManagement.IVariable
Implements a decision variable.
- Author:
- Marcel Lueder, Holger Eichelberger
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for serialization.DecisionVariableDeclaration(String name, IDatatype type, IModelElement parent) Constructor for decision variable declaration. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(IModelVisitor visitor) Accept method for the visitor.private booleanaddAttribute(Attribute attribute) Adds an attribute.booleanAttributes this element.getAttribute(int index) Returns a specific attribute.getAttribute(String name) Returns a specific attribute.intReturns the number of attributes.booleanReturns whether this variable is an attribute.booleanReturns whether this variable is a constant.booleanIn case that this instance is used as a (set operation) declarator, was the type declared explicitly in the model?booleanReturns whether this variable is a temporary declarator, i.e., a temporary variable create to quality an unqualified container iterator.booleanReturns whether this decision variable declaration is used as a temporary variable (in constraints, i.e.private static net.ssehub.easy.basics.logger.EASyLoggerFactory.EASyLoggerlogger()Logger.booleanpropagateAttribute(Attribute attribute) Propagates an attribute application from the parent to this element or contained elements.Methods inherited from class net.ssehub.easy.varModel.model.AbstractVariable
constraintsChanged, equals, getDefaultValue, getType, hashCode, isSame, setValue, setValue, setValueMethods inherited from class net.ssehub.easy.varModel.model.ContainableModelElement
accept, getNameSpace, getParent, getProject, getQualifiedName, getTopLevelParent, isTopLevel, setParentMethods inherited from class net.ssehub.easy.varModel.model.ModelElement
findAttribute, getComment, getName, getUniqueName, isTransparent, setComment, setName, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.ssehub.easy.varModel.model.IAttributableElement
getName, getQualifiedNameMethods inherited from interface net.ssehub.easy.varModel.model.IFreezable
getName, getParent, getType
-
Field Details
-
attributes
-
-
Constructor Details
-
DecisionVariableDeclaration
DecisionVariableDeclaration()Constructor for serialization. -
DecisionVariableDeclaration
Constructor for decision variable declaration.- Parameters:
name- Name of the decision variable declarationtype- type of the new VariableDeclarationparent- the object, in which this specific one is embedded
-
-
Method Details
-
accept
Description copied from interface:IFreezableAccept method for the visitor.- Specified by:
acceptin interfaceIFreezable- Specified by:
acceptin interfaceIModelElement- Parameters:
visitor- The visitor, which should process this model element.
-
addAttribute
Adds an attribute.- Parameters:
attribute- the attribute to be added- Returns:
trueif the operation was successful,falseif the element is about being attributed multiple times with the same attribute
-
attribute
Attributes this element.- Specified by:
attributein interfaceIAttributableElement- Parameters:
attribute- the attribute to be added- Returns:
trueif the operation was successful,falseif the element is about being attributed multiple times with the same attribute
-
getAttributesCount
public int getAttributesCount()Returns the number of attributes.- Specified by:
getAttributesCountin interfaceIAttributeAccess- Returns:
- the number of attributes
-
getAttribute
Returns a specific attribute.- Specified by:
getAttributein interfaceIAttributeAccess- Parameters:
index- the index of the attribute- Returns:
- the attribute
- Throws:
IndexOutOfBoundsException- ifindex<0 || index>=getAttributesCount()
-
getAttribute
Returns a specific attribute.- Specified by:
getAttributein interfaceIAttributeAccess- Parameters:
name- the name of the attribute- Returns:
- the attribute (or null if not found)
-
isTemporaryVariable
public boolean isTemporaryVariable()Description copied from class:AbstractVariableReturns whether this decision variable declaration is used as a temporary variable (in constraints, i.e. the parent is a constraint).- Specified by:
isTemporaryVariablein classAbstractVariable- Returns:
trueif it is a temporary variable,falseif it is a defined variable in the model
-
isTemporaryDeclarator
public boolean isTemporaryDeclarator()Returns whether this variable is a temporary declarator, i.e., a temporary variable create to quality an unqualified container iterator.- Returns:
truefor temporary,falseelse
-
isAttribute
public boolean isAttribute()Returns whether this variable is an attribute.- Specified by:
isAttributein classAbstractVariable- Returns:
trueif it is an attribute,falseelse
-
propagateAttribute
Description copied from interface:IModelElementPropagates an attribute application from the parent to this element or contained elements. This may imply the creation of clones of the givenattribute.- Specified by:
propagateAttributein interfaceIModelElement- Overrides:
propagateAttributein classModelElement- Parameters:
attribute- the attribute to be propagated- Returns:
trueif the operation was successful,falseif the element is about being attributed multiple times with the same attribute
-
logger
private static net.ssehub.easy.basics.logger.EASyLoggerFactory.EASyLogger logger()Logger.- Returns:
- logger
-
isDeclaratorTypeExplicit
public boolean isDeclaratorTypeExplicit()In case that this instance is used as a (set operation) declarator, was the type declared explicitly in the model?- Returns:
falseif not explicit,trueif explicit
-
isConstant
public boolean isConstant()Description copied from class:AbstractVariableReturns whether this variable is a constant.- Specified by:
isConstantin classAbstractVariable- Returns:
truefor constant,falseelse
-