Package de.monticore.types.check
Class SymTypePrimitive
- java.lang.Object
-
- de.monticore.types.check.SymTypeExpression
-
- de.monticore.types.check.SymTypePrimitive
-
public class SymTypePrimitive extends SymTypeExpression
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Map<java.lang.String,java.lang.String>boxMapDeprecated.static java.util.List<java.lang.String>primitiveTypesDeprecated, for removal: This API element is subject to removal in a future version.cannot assume fixed set for all languagesprotected TypeSymboltypeSymbolstatic java.util.Map<java.lang.String,java.lang.String>unboxMapDeprecated.-
Fields inherited from class de.monticore.types.check.SymTypeExpression
functionList, LOG_NAME, sourceInfo
-
-
Constructor Summary
Constructors Constructor Description SymTypePrimitive(TypeSymbol typeSymbol)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaccept(ISymTypeVisitor visitor)SymTypePrimitiveasPrimitive()static java.lang.Stringbox(java.lang.String unboxedName)Deprecated.use SymTypeBoxingVisitorbooleandeepEquals(SymTypeExpression sym)java.lang.StringgetBaseOfBoxedName()Deprecated, for removal: This API element is subject to removal in a future version.only used in 1 test ONCE...java.lang.StringgetBoxedPrimitiveName()Deprecated.java.lang.StringgetPrimitiveName()TypeSymbolgetTypeInfo()Returns an TypeSymbol representing the type Only to be called according toSymTypeExpression.hasTypeInfo()booleanhasTypeInfo()Whether we can call getTypeInfobooleanisIntegralType()Checks whether it is an integer type (incl.booleanisNumericType()Checks whether it is a numeric type (incl.booleanisPrimitive()Am I primitive? (such as "int") (default: no)voidsetPrimitiveName(java.lang.String constName)Deprecated, for removal: This API element is subject to removal in a future version.only used in tests in our main projectsstatic java.lang.Stringunbox(java.lang.String boxedName)Deprecated.use SymTypeUnboxingVisitor-
Methods inherited from class de.monticore.types.check.SymTypeExpression
_internal_setSourceInfo, asArrayType, asFunctionType, asGenericType, asInferenceVariable, asIntersectionType, asNullType, asNumericWithSIUnitType, asObjectType, asObscureType, asRegExType, asSIUnitType, asTupleType, asTypeVariable, asUnionType, asVoidType, asWildcard, deepClone, getCorrectFields, getCorrectFields, getCorrectMethods, getCorrectMethods, getFieldList, getFieldList, getFieldList, getFieldList, getMethodList, getMethodList, getMethodList, getMethodList, getSourceInfo, isArrayType, isFunctionType, isGenericType, isInferenceVariable, isIntersectionType, isNullType, isNumericWithSIUnitType, isObjectType, isObscureType, isRegExType, isSIUnitType, isTupleType, isTypeVariable, isUnionType, isValidType, isVoidType, isWildcard, print, printAsJson, printFullName, replaceTypeVariables, transformFieldList, transformMethodList
-
-
-
-
Field Detail
-
typeSymbol
protected TypeSymbol typeSymbol
-
primitiveTypes
@Deprecated(forRemoval=true) public static final java.util.List<java.lang.String> primitiveTypes
Deprecated, for removal: This API element is subject to removal in a future version.cannot assume fixed set for all languagesList of potential constants (on purpose not implemented as enum)
-
unboxMap
@Deprecated public static final java.util.Map<java.lang.String,java.lang.String> unboxMap
Deprecated.Map for unboxing const types (e.g. "java.lang.Boolean" -> "boolean")
-
boxMap
@Deprecated public static final java.util.Map<java.lang.String,java.lang.String> boxMap
Deprecated.Map for boxing const types (e.g. "boolean" -> "java.lang.Boolean") Results are fully qualified.
-
-
Constructor Detail
-
SymTypePrimitive
public SymTypePrimitive(TypeSymbol typeSymbol)
-
-
Method Detail
-
hasTypeInfo
public boolean hasTypeInfo()
Description copied from class:SymTypeExpressionWhether we can call getTypeInfo- Overrides:
hasTypeInfoin classSymTypeExpression
-
getTypeInfo
public TypeSymbol getTypeInfo()
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
-
getPrimitiveName
public java.lang.String getPrimitiveName()
-
getBoxedPrimitiveName
@Deprecated public java.lang.String getBoxedPrimitiveName()
Deprecated.
-
getBaseOfBoxedName
@Deprecated(forRemoval=true) public java.lang.String getBaseOfBoxedName()
Deprecated, for removal: This API element is subject to removal in a future version.only used in 1 test ONCE... in our main projects
-
setPrimitiveName
@Deprecated(forRemoval=true) public void setPrimitiveName(java.lang.String constName)
Deprecated, for removal: This API element is subject to removal in a future version.only used in tests in our main projects
-
unbox
@Deprecated public static java.lang.String unbox(java.lang.String boxedName)
Deprecated.use SymTypeUnboxingVisitorunboxing const types (e.g."java.lang.Boolean" -> "boolean"). otherwise return is unchanged- Parameters:
boxedName-- Returns:
-
box
@Deprecated public static java.lang.String box(java.lang.String unboxedName)
Deprecated.use SymTypeBoxingVisitorBoxing const types (e.g."boolean" -> "java.lang.Boolean") Results are fully qualified. Otherwise return is unchanged- Parameters:
unboxedName-- Returns:
-
isIntegralType
public boolean isIntegralType()
Checks whether it is an integer type (incl. byte, long, char)- Returns:
- true if the given type is an integral type
-
isNumericType
public boolean isNumericType()
Checks whether it is a numeric type (incl. byte, long, char, float)- Returns:
- true if the given type is a numeric type
-
isPrimitive
public boolean isPrimitive()
Description copied from class:SymTypeExpressionAm I primitive? (such as "int") (default: no)- Overrides:
isPrimitivein classSymTypeExpression
-
asPrimitive
public SymTypePrimitive asPrimitive()
- Overrides:
asPrimitivein classSymTypeExpression
-
deepEquals
public boolean deepEquals(SymTypeExpression sym)
- Specified by:
deepEqualsin classSymTypeExpression
-
accept
public void accept(ISymTypeVisitor visitor)
- Overrides:
acceptin classSymTypeExpression
-
-