Package de.monticore.types.check
Class TypeRelations
java.lang.Object
de.monticore.types.check.TypeRelations
- All Implemented Interfaces:
ITypeRelations
Deprecated.
This Class provides the default implementation of
ITypeRelations-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcalculateInheritanceDistance(SymTypeExpression specific, SymTypeExpression general) Deprecated.calculate the minimum inheritance distance from the specific type to the general type e.g.intcalculateInheritanceDistance(SymTypePrimitive specific, SymTypePrimitive general) Deprecated.booleancompatible(SymTypeExpression left, SymTypeExpression right) Deprecated.Function 3: Given two SymTypeExpressions super, sub: This function answers, whether the right type is a subtype of the left type in an assignment.booleanisBoolean(SymTypeExpression type) Deprecated.booleanisByte(SymTypeExpression type) Deprecated.booleanisChar(SymTypeExpression type) Deprecated.booleanisDouble(SymTypeExpression type) Deprecated.booleanisFloat(SymTypeExpression type) Deprecated.booleanisInt(SymTypeExpression type) Deprecated.booleanDeprecated.booleanisLong(SymTypeExpression type) Deprecated.booleanDeprecated.booleanisShort(SymTypeExpression type) Deprecated.booleanisString(SymTypeExpression type) Deprecated.booleanisSubtypeOf(SymTypeExpression subType, SymTypeExpression superType) Deprecated.determines if one SymTypeExpression is a subtype of another SymTypeExpressionprotected booleanisSubtypeOfRec(SymTypeExpression subType, SymTypeExpression superType) Deprecated.booleanisVoid(SymTypeExpression type) Deprecated.
-
Constructor Details
-
TypeRelations
public TypeRelations()Deprecated.
-
-
Method Details
-
compatible
Deprecated.Description copied from interface:ITypeRelationsFunction 3: Given two SymTypeExpressions super, sub: This function answers, whether the right type is a subtype of the left type in an assignment. (This allows to store/use values of type "sub" at all positions of type "super". Compatibility examples: compatible("int", "long") (in all directions) compatible("long", "int") (in all directions) compatible("double", "float") (in all directions) compatible("Person", "Student") (uni-directional)Incompatible:
!compatible("double", "int")(in all directions)The concrete Typechecker has to decide on further issues, like
!compatible("List<double>", "List<int>")where e.g. Java and OCL/P differ in their answers- Specified by:
compatiblein interfaceITypeRelations- Parameters:
left- Super-Typeright- Sub-Type (assignment-compatible to supertype?)
-
isSubtypeOf
Deprecated.Description copied from interface:ITypeRelationsdetermines if one SymTypeExpression is a subtype of another SymTypeExpression- Specified by:
isSubtypeOfin interfaceITypeRelations- Parameters:
subType- the SymTypeExpression that could be a subtype of the other SymTypeExpressionsuperType- the SymTypeExpression that could be a supertype of the other SymTypeExpression
-
isSubtypeOfRec
Deprecated. -
calculateInheritanceDistance
Deprecated.Description copied from interface:ITypeRelationscalculate the minimum inheritance distance from the specific type to the general type e.g. C extends B extends A: object of type C has distance of 2 to object of type A object of type B has distance of 1 to object of type A object of type A has distance of 0 to object of type A- Specified by:
calculateInheritanceDistancein interfaceITypeRelations- Parameters:
specific- the specific typegeneral- the general type- Returns:
- 0 if they are the same type, else their minimum inheritance distance
-
calculateInheritanceDistance
Deprecated.- Specified by:
calculateInheritanceDistancein interfaceITypeRelations
-
isBoolean
Deprecated.- Specified by:
isBooleanin interfaceITypeRelations
-
isInt
Deprecated.- Specified by:
isIntin interfaceITypeRelations
-
isDouble
Deprecated.- Specified by:
isDoublein interfaceITypeRelations
-
isFloat
Deprecated.- Specified by:
isFloatin interfaceITypeRelations
-
isLong
Deprecated.- Specified by:
isLongin interfaceITypeRelations
-
isChar
Deprecated.- Specified by:
isCharin interfaceITypeRelations
-
isShort
Deprecated.- Specified by:
isShortin interfaceITypeRelations
-
isByte
Deprecated.- Specified by:
isBytein interfaceITypeRelations
-
isVoid
Deprecated.- Specified by:
isVoidin interfaceITypeRelations
-
isString
Deprecated.- Specified by:
isStringin interfaceITypeRelations
-
isNumericType
Deprecated.- Specified by:
isNumericTypein interfaceITypeRelations
-
isIntegralType
Deprecated.- Specified by:
isIntegralTypein interfaceITypeRelations
-
SymTypeRelations