Class Reference
- 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.Reference
-
- All Implemented Interfaces:
IDatatype,IDatatypeVisitable,IModelElement
public class Reference extends CustomDatatype
A reference allows the definition of individual configurations of an (external) element for the referencing element. Currently, operations such as assignments are represented as the respective operations of the base type. Actually, this may be confusing / wrong. SeeConstraintSyntaxTree.inferDatatype().- Author:
- heiko beck, Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description static OperationASSIGNMENTstatic OperationCOPY(package private) static DelegatingTypeDTYPEstatic OperationEQUALSstatic OperationIS_DEFINEDstatic OperationREF_BYprivate IDatatypetypestatic IDatatypeTYPEThis constant represents the common type of all references.static OperationTYPE_OFstatic OperationUNEQUALSstatic OperationUNEQUALS_ALIAS
-
Constructor Summary
Constructors Modifier Constructor Description privateReference()Creates the singleton instance forTYPE.Reference(java.lang.String name, IDatatype type, ModelElement parent)Constructor for the reference.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(IDatatypeVisitor visitor)Accepts a specialized visitor for creating a textual representation of the identity of this type.voidaccept(IModelVisitor visitor)Accept method for the visitor.static IDatatypedereference(IDatatype type)Aims at dereferencetypein case that it is a reference.static voiddereference(IDatatype[] types)Dereferences all datatypes intype.IDatatypegetType()Returns the type this reference is referring to.booleanisAssignableFrom(IDatatype type)Determines if the data type represented by this object is either the same as, or is a supertype oftype.static booleanisReferenceTo(IDatatype type, IDatatype parameter)Returns whether the giventypeis a reference with givengeneric.-
Methods inherited from class net.ssehub.easy.varModel.model.datatypes.CustomDatatype
getGenericType, getGenericTypeCount, getOperation, getOperationCount, getTypeClass, isPrimitive, isPseudoType, isType
-
Methods inherited from class net.ssehub.easy.varModel.model.ContainableModelElement
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
-
-
-
-
Field Detail
-
DTYPE
static final DelegatingType DTYPE
-
TYPE
public static final IDatatype TYPE
This constant represents the common type of all references. Each specific reference type is assignable to this type.
-
TYPE_OF
public static final Operation TYPE_OF
-
EQUALS
public static final Operation EQUALS
-
UNEQUALS
public static final Operation UNEQUALS
-
UNEQUALS_ALIAS
public static final Operation UNEQUALS_ALIAS
-
ASSIGNMENT
public static final Operation ASSIGNMENT
-
IS_DEFINED
public static final Operation IS_DEFINED
-
COPY
public static final Operation COPY
-
REF_BY
public static final Operation REF_BY
-
type
private IDatatype type
-
-
Constructor Detail
-
Reference
private Reference()
Creates the singleton instance forTYPE.
-
Reference
public Reference(java.lang.String name, IDatatype type, ModelElement parent)Constructor for the reference.- Parameters:
name- Name of referencetype- the type to refer toparent- the object, in which this specific one is embedded
-
-
Method Detail
-
getType
public IDatatype getType()
Returns the type this reference is referring to.- Specified by:
getTypein interfaceIDatatype- Overrides:
getTypein classCustomDatatype- Returns:
- the type
-
accept
public void accept(IModelVisitor visitor)
Accept method for the visitor.- Parameters:
visitor- The visitor, which should process this model element.
-
accept
public void accept(IDatatypeVisitor visitor)
Description copied from interface:IDatatypeVisitableAccepts a specialized visitor for creating a textual representation of the identity of this type.- Specified by:
acceptin interfaceIDatatypeVisitable- Overrides:
acceptin classContainableModelElement- Parameters:
visitor- the visitor to accept
-
isAssignableFrom
public boolean isAssignableFrom(IDatatype type)
Determines 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
-
dereference
public static IDatatype dereference(IDatatype type)
Aims at dereferencetypein case that it is a reference.- Parameters:
type- the type to dereference- Returns:
- the dereferenced type (or
typeiftypewas not a reference)
-
dereference
public static void dereference(IDatatype[] types)
Dereferences all datatypes intype.- Parameters:
types- the types to be dereferenced
-
isReferenceTo
public static boolean isReferenceTo(IDatatype type, IDatatype parameter)
Returns whether the giventypeis a reference with givengeneric.- Parameters:
type- the type to checkparameter- the parameter type of the expected reference (may also be a more generic type)- Returns:
trueiftypeisrefTo(generic),falseelse
-
-