Package net.ssehub.easy.varModel.cst
Class AttributeVariable
java.lang.Object
net.ssehub.easy.varModel.cst.ConstraintSyntaxTree
net.ssehub.easy.varModel.cst.Leaf
net.ssehub.easy.varModel.cst.Variable
net.ssehub.easy.varModel.cst.AttributeVariable
- All Implemented Interfaces:
IAttributeAccess
A variable which represents an attribute. However, access to an attribute
may be qualified, e.g. via a
CompoundAccess, i.e., qualifier.attribute
whereby qualifier may even be c.a.attribute of unlimited nesting.
However, the attribute shall point to the original definition of the attribute
variable. This class is a (polymorphic)
subclass of Variable as it just adds an attribute (and helps saving
memory in case that the qualifying attribute is not needed).- Author:
- Holger Eichelberger
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for serialization.AttributeVariable(ConstraintSyntaxTree qualifier, Attribute attribute) Creates an attribute variable. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(IConstraintTreeVisitor visitor) Visiting method for the visitor.booleanReturns the qualifier for accessing the variable, e.g., an expression to be put before.inthashCode()Infers the datatype of the subtree represented by this object.toString()Methods inherited from class net.ssehub.easy.varModel.cst.Variable
getAttribute, getAttributesCount, getResolved, getVariable, isSemanticallyEqualMethods inherited from class net.ssehub.easy.varModel.cst.ConstraintSyntaxTree
getAttribute, getContainedType, getName, getParent
-
Field Details
-
qualifier
-
-
Constructor Details
-
AttributeVariable
AttributeVariable()Constructor for serialization. -
AttributeVariable
Creates an attribute variable.- Parameters:
qualifier- an optional expression required to uniquely address the specific variable theattributeis referring to (may be null)attribute- the attribute (as variable)
-
-
Method Details
-
getQualifier
Returns the qualifier for accessing the variable, e.g., an expression to be put before.- Overrides:
getQualifierin classVariable- Returns:
- the qualifier (may be null)
-
equals
-
hashCode
public int hashCode() -
toString
-
accept
Description copied from class:ConstraintSyntaxTreeVisiting method for the visitor.
This method is used for saving this model element. -
inferDatatype
Description copied from class:ConstraintSyntaxTreeInfers the datatype of the subtree represented by this object.- Overrides:
inferDatatypein classVariable- Returns:
- the data type
- Throws:
CSTSemanticException- Will be thrown if parameters of (sub-) trees do not fit together.
-