Class FreezeVariableType
- java.lang.Object
-
- net.ssehub.easy.varModel.model.ModelElement
-
- net.ssehub.easy.varModel.model.ContainableModelElement
-
- net.ssehub.easy.varModel.model.datatypes.CustomDatatype
-
- net.ssehub.easy.varModel.model.datatypes.StructuredDatatype
-
- net.ssehub.easy.varModel.model.datatypes.FreezeVariableType
-
- All Implemented Interfaces:
IDatatype,IDatatypeVisitable,IModelElement
public class FreezeVariableType extends StructuredDatatype
An internal type for freezes to iterate / specify expressions on freezables.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<Attribute>attributes(package private) static DelegatingTypeDTYPEstatic OperationNAMEstatic OperationNAME2static OperationQNAMEstatic OperationQNAME2static IDatatypeTYPEThis constant represents the common type of all freeze variables.
-
Constructor Summary
Constructors Modifier Constructor Description privateFreezeVariableType()Creates the singleton instance forTYPE.FreezeVariableType(IFreezable[] freezables, IModelElement parent)Constructor for a specific freeze variable type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(IModelVisitor visitor)Accept method for the visitor.(package private) voidaddAttribute(Attribute attribute)Adds an attribute to this type.AttributegetAttribute(int index)Returns the specified attribute.AttributegetAttribute(java.lang.String name)Returns the attribute of the givenname.intgetAttributesCount()Returns the number of attributes.private voidindexAttributes(IFreezable freezable, java.util.Map<java.lang.String,Attribute> attributes)Indexes all attributes for adding them to the internal type.booleanisAssignableFrom(IDatatype type)Determines if the data type represented by this object is either the same as, or is a supertype oftype.-
Methods inherited from class net.ssehub.easy.varModel.model.datatypes.CustomDatatype
getGenericType, getGenericTypeCount, getOperation, getOperationCount, getType, getTypeClass, isPrimitive, isPseudoType, isType
-
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, toString
-
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.datatypes.IDatatype
getName, getNameSpace, getQualifiedName, getUniqueName
-
Methods inherited from interface net.ssehub.easy.varModel.model.datatypes.IDatatypeVisitable
accept
-
-
-
-
Field Detail
-
DTYPE
static final DelegatingType DTYPE
-
TYPE
public static final IDatatype TYPE
This constant represents the common type of all freeze variables. Each specific freeze variable type is assignable to this type.
-
NAME
public static final Operation NAME
-
NAME2
public static final Operation NAME2
-
QNAME
public static final Operation QNAME
-
QNAME2
public static final Operation QNAME2
-
attributes
private java.util.List<Attribute> attributes
-
-
Constructor Detail
-
FreezeVariableType
private FreezeVariableType()
Creates the singleton instance forTYPE.
-
FreezeVariableType
public FreezeVariableType(IFreezable[] freezables, IModelElement parent)
Constructor for a specific freeze variable type.- Parameters:
freezables- the freezables to derive the structure of this type fromparent- the object, in which this specific one is embedded
-
-
Method Detail
-
indexAttributes
private void indexAttributes(IFreezable freezable, java.util.Map<java.lang.String,Attribute> attributes)
Indexes all attributes for adding them to the internal type.- Parameters:
freezable- the freezable to be analyzedattributes- the name-attributes map (modified as a side effect)
-
accept
public void accept(IModelVisitor visitor)
Description copied from interface:IModelElementAccept method for the visitor.- Parameters:
visitor- The visitor, which should process this model element.
-
isAssignableFrom
public boolean isAssignableFrom(IDatatype type)
Description copied from class:CustomDatatypeDetermines if the data type represented by this object is either the same as, or is a supertype oftype.- Specified by:
isAssignableFromin interfaceIDatatype- Overrides:
isAssignableFromin classCustomDatatype- Parameters:
type- the type being checked- Returns:
trueif this type is either the same or a supertype oftype,trueelse
-
addAttribute
void addAttribute(Attribute attribute)
Adds an attribute to this type.- Parameters:
attribute- the attribute to be added
-
getAttributesCount
public int getAttributesCount()
Returns the number of attributes.- Returns:
- the number of attributes
-
getAttribute
public Attribute getAttribute(int index)
Returns the specified attribute.- Parameters:
index- the 0-based index of the attribute to return- Returns:
- the specified attribute
- Throws:
java.lang.IndexOutOfBoundsException- ifindex<0 || index>=getAttributesCount()
-
getAttribute
public Attribute getAttribute(java.lang.String name)
Returns the attribute of the givenname.- Parameters:
name- the name of the attribute- Returns:
- the attribute or null if none was found
-
-