Package de.monticore.types.check
Class SymTypeVariable
- java.lang.Object
-
- de.monticore.types.check.SymTypeExpression
-
- de.monticore.types.check.SymTypeVariable
-
public class SymTypeVariable extends SymTypeExpression
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringLOG_NAMEprotected TypeVarSymboltypeVarSymbol-
Fields inherited from class de.monticore.types.check.SymTypeExpression
functionList, sourceInfo, typeSymbol
-
-
Constructor Summary
Constructors Constructor Description SymTypeVariable(TypeSymbol typeSymbol)Deprecated.SymTypeVariable(TypeVarSymbol typeSymbol)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaccept(ISymTypeVisitor visitor)SymTypeVariableasTypeVariable()SymTypeVariabledeepClone()booleandeepEquals(SymTypeExpression sym)booleandenotesSameVar(SymTypeExpression other)Similar to deepEquals, but only checks whether the variables are supposed to be the same variable.TypeSymbolgetTypeInfo()Deprecated.TypeVarSymbolgetTypeVarSymbol()SymTypeExpressiongetUpperBound()a type variable only allows sub-types of its upper bound, e.g., T extends Numberjava.lang.StringgetVarName()Deprecated, for removal: This API element is subject to removal in a future version.unused in main projects also: getter and setter do something different, questionablebooleanhasTypeVarSymbol()Deprecated.(should) return truebooleanisPrimitive()Am I primitive? (such as "int") (default: no)booleanisTypeVariable()Am I a bound type variable?booleanisValidType()Am I a not valid type? e.g.java.lang.Stringprint()print: Conversion to a compact string, such as"int","Person","List< A >"java.lang.StringprintFullName()printFullName: prints the full name of the symbol, such as"java.util.List<java.lang.String>"voidsetVarName(java.lang.String name)Deprecated, for removal: This API element is subject to removal in a future version.unused in main projects-
Methods inherited from class de.monticore.types.check.SymTypeExpression
_internal_setSourceInfo, asArrayType, asFunctionType, asGenericType, asInferenceVariable, asIntersectionType, asNullType, asNumericWithSIUnitType, asObjectType, asObscureType, asPrimitive, asRegExType, asSIUnitType, asTupleType, asUnionType, asVoidType, asWildcard, getCorrectFields, getCorrectFields, getCorrectMethods, getCorrectMethods, getFieldList, getFieldList, getFieldList, getFieldList, getMethodList, getMethodList, getMethodList, getMethodList, getSourceInfo, hasTypeInfo, isArrayType, isFunctionType, isGenericType, isInferenceVariable, isIntersectionType, isNullType, isNumericWithSIUnitType, isObjectType, isObscureType, isRegExType, isSIUnitType, isTupleType, isUnionType, isVoidType, isWildcard, printAsJson, replaceTypeVariables, transformFieldList, transformMethodList
-
-
-
-
Field Detail
-
LOG_NAME
protected static final java.lang.String LOG_NAME
- See Also:
- Constant Field Values
-
typeVarSymbol
protected TypeVarSymbol typeVarSymbol
-
-
Constructor Detail
-
SymTypeVariable
public SymTypeVariable(TypeVarSymbol typeSymbol)
-
SymTypeVariable
@Deprecated public SymTypeVariable(TypeSymbol typeSymbol)
Deprecated.
-
-
Method Detail
-
hasTypeVarSymbol
@Deprecated public boolean hasTypeVarSymbol()
Deprecated.(should) return true
-
getTypeVarSymbol
public TypeVarSymbol getTypeVarSymbol()
-
getTypeInfo
@Deprecated public TypeSymbol getTypeInfo()
Deprecated.Description copied from class:SymTypeExpressionReturns an TypeSymbol representing the type Only to be called according toSymTypeExpression.hasTypeInfo()As most SymTypeExpressions do not have a TypeSymbol (this is legacy), this method will log a warning and is expected to be overridden, if a TypeSymbol exists.
- Overrides:
getTypeInfoin classSymTypeExpression
-
getUpperBound
public SymTypeExpression getUpperBound()
a type variable only allows sub-types of its upper bound, e.g., T extends Number
-
getVarName
@Deprecated(forRemoval=true) public java.lang.String getVarName()
Deprecated, for removal: This API element is subject to removal in a future version.unused in main projects also: getter and setter do something different, questionable
-
setVarName
@Deprecated(forRemoval=true) public void setVarName(java.lang.String name)
Deprecated, for removal: This API element is subject to removal in a future version.unused in main projects
-
print
public java.lang.String print()
Description copied from class:SymTypeExpressionprint: Conversion to a compact string, such as"int","Person","List< A >"- Overrides:
printin classSymTypeExpression
-
printFullName
public java.lang.String printFullName()
Description copied from class:SymTypeExpressionprintFullName: prints the full name of the symbol, such as"java.util.List<java.lang.String>"- Overrides:
printFullNamein classSymTypeExpression- Returns:
-
isPrimitive
public boolean isPrimitive()
Description copied from class:SymTypeExpressionAm I primitive? (such as "int") (default: no)- Overrides:
isPrimitivein classSymTypeExpression
-
isValidType
public boolean isValidType()
Description copied from class:SymTypeExpressionAm I a not valid type? e.g. unknown type, not all type variables set, pseudo types like typeVariables- Overrides:
isValidTypein classSymTypeExpression
-
isTypeVariable
public boolean isTypeVariable()
Description copied from class:SymTypeExpressionAm I a bound type variable?- Overrides:
isTypeVariablein classSymTypeExpression
-
asTypeVariable
public SymTypeVariable asTypeVariable()
- Overrides:
asTypeVariablein classSymTypeExpression
-
deepClone
public SymTypeVariable deepClone()
- Overrides:
deepClonein classSymTypeExpression
-
denotesSameVar
public boolean denotesSameVar(SymTypeExpression other)
Similar to deepEquals, but only checks whether the variables are supposed to be the same variable. E.g., bounds are ignored
-
deepEquals
public boolean deepEquals(SymTypeExpression sym)
- Specified by:
deepEqualsin classSymTypeExpression
-
accept
public void accept(ISymTypeVisitor visitor)
- Overrides:
acceptin classSymTypeExpression
-
-