Package de.monticore.types.check
Class SymTypeInferenceVariable
- java.lang.Object
-
- de.monticore.types.check.SymTypeExpression
-
- de.monticore.types.check.SymTypeInferenceVariable
-
public class SymTypeInferenceVariable extends SymTypeExpression
-
-
Field Summary
Fields Modifier and Type Field Description protected intidThis holds a number of the free type variable, which acts as an identifier.protected java.lang.StringidStra short string, e.g., "FV", that is output with the id while printingprotected SymTypeExpressionlowerBoundprotected static java.util.concurrent.atomic.AtomicIntegertypeInfIDCounterprotected SymTypeExpressionupperBound-
Fields inherited from class de.monticore.types.check.SymTypeExpression
functionList, LOG_NAME, sourceInfo, typeSymbol
-
-
Constructor Summary
Constructors Constructor Description SymTypeInferenceVariable(int id, java.lang.String idStr, SymTypeExpression lowerBound, SymTypeExpression upperBound)INTERNAL, DO NOT USE: used for deepcloningSymTypeInferenceVariable(java.lang.String idStr, SymTypeExpression lowerBound, SymTypeExpression upperBound)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int_internal_getID()accessible for printing, sorting, etc.java.lang.String_internal_getIDStr()accessible for printing usually, you do not need/want this.voidaccept(ISymTypeVisitor visitor)SymTypeInferenceVariableasInferenceVariable()SymTypeInferenceVariabledeepClone()booleandeepEquals(SymTypeExpression sym)booleandenotesSameVar(SymTypeExpression other)Similar to deepEquals, but only checks whether the variables are supposed to be the same variable.SymTypeExpressiongetLowerBound()protected static intgetUniqueID()SymTypeExpressiongetUpperBound()booleanisInferenceVariable()Am I a free type variable?booleanisPrimitive()Am I primitive? (such as "int") (default: no)-
Methods inherited from class de.monticore.types.check.SymTypeExpression
_internal_setSourceInfo, asArrayType, asFunctionType, asGenericType, asIntersectionType, asNullType, asNumericWithSIUnitType, asObjectType, asObscureType, asPrimitive, asRegExType, asSIUnitType, asTupleType, asTypeVariable, asUnionType, asVoidType, asWildcard, getCorrectFields, getCorrectFields, getCorrectMethods, getCorrectMethods, getFieldList, getFieldList, getFieldList, getFieldList, getMethodList, getMethodList, getMethodList, getMethodList, getSourceInfo, getTypeInfo, hasTypeInfo, isArrayType, isFunctionType, isGenericType, isIntersectionType, isNullType, isNumericWithSIUnitType, isObjectType, isObscureType, isRegExType, isSIUnitType, isTupleType, isTypeVariable, isUnionType, isValidType, isVoidType, isWildcard, print, printAsJson, printFullName, replaceTypeVariables, transformFieldList, transformMethodList
-
-
-
-
Field Detail
-
id
protected int id
This holds a number of the free type variable, which acts as an identifier. The Only guarantee is that the ids are unique. Never test against them.
-
idStr
protected java.lang.String idStr
a short string, e.g., "FV", that is output with the id while printing
-
lowerBound
protected SymTypeExpression lowerBound
-
upperBound
protected SymTypeExpression upperBound
-
typeInfIDCounter
protected static java.util.concurrent.atomic.AtomicInteger typeInfIDCounter
-
-
Constructor Detail
-
SymTypeInferenceVariable
public SymTypeInferenceVariable(java.lang.String idStr, SymTypeExpression lowerBound, SymTypeExpression upperBound)
-
SymTypeInferenceVariable
public SymTypeInferenceVariable(int id, java.lang.String idStr, SymTypeExpression lowerBound, SymTypeExpression upperBound)INTERNAL, DO NOT USE: used for deepcloning
-
-
Method Detail
-
getLowerBound
public SymTypeExpression getLowerBound()
-
getUpperBound
public SymTypeExpression getUpperBound()
-
_internal_getID
public int _internal_getID()
accessible for printing, sorting, etc. usually, you do not need/want this.
-
_internal_getIDStr
public java.lang.String _internal_getIDStr()
accessible for printing usually, you do not need/want this.
-
isPrimitive
public boolean isPrimitive()
Description copied from class:SymTypeExpressionAm I primitive? (such as "int") (default: no)- Overrides:
isPrimitivein classSymTypeExpression
-
isInferenceVariable
public boolean isInferenceVariable()
Description copied from class:SymTypeExpressionAm I a free type variable?- Overrides:
isInferenceVariablein classSymTypeExpression
-
asInferenceVariable
public SymTypeInferenceVariable asInferenceVariable()
- Overrides:
asInferenceVariablein classSymTypeExpression
-
deepClone
public SymTypeInferenceVariable 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
-
getUniqueID
protected static int getUniqueID()
-
-