Class SymTypePrimitive

java.lang.Object
de.monticore.types.check.SymTypeExpression
de.monticore.types.check.SymTypePrimitive
All Implemented Interfaces:
Comparable<SymTypeExpression>

public class SymTypePrimitive extends SymTypeExpression
  • Field Details

    • typeSymbol

      protected TypeSymbol typeSymbol
    • primitiveTypes

      @Deprecated(forRemoval=true) public static final List<String> primitiveTypes
      Deprecated, for removal: This API element is subject to removal in a future version.
      cannot assume fixed set for all languages
      List of potential constants (on purpose not implemented as enum)
    • unboxMap

      @Deprecated(forRemoval=true) public static final Map<String,String> unboxMap
      Deprecated, for removal: This API element is subject to removal in a future version.
      Map for unboxing const types (e.g. "java.lang.Boolean" -> "boolean")
    • boxMap

      @Deprecated(forRemoval=true) public static final Map<String,String> boxMap
      Deprecated, for removal: This API element is subject to removal in a future version.
      Map for boxing const types (e.g. "boolean" -> "java.lang.Boolean") Results are fully qualified.
  • Constructor Details

    • SymTypePrimitive

      public SymTypePrimitive(TypeSymbol typeSymbol)
  • Method Details

    • hasTypeInfo

      public boolean hasTypeInfo()
      Description copied from class: SymTypeExpression
      Whether we can call getTypeInfo
      Overrides:
      hasTypeInfo in class SymTypeExpression
    • getTypeInfo

      public TypeSymbol getTypeInfo()
      Description copied from class: SymTypeExpression
      Returns an TypeSymbol representing the type Only to be called according to SymTypeExpression.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:
      getTypeInfo in class SymTypeExpression
    • getPrimitiveName

      public String getPrimitiveName()
    • getBoxedPrimitiveName

      @Deprecated(forRemoval=true) public String getBoxedPrimitiveName()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getBaseOfBoxedName

      @Deprecated(forRemoval=true) public 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(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(forRemoval=true) public static String unbox(String boxedName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use SymTypeRelations
      unboxing const types (e.g. "java.lang.Boolean" -> "boolean"). otherwise return is unchanged
      Parameters:
      boxedName -
      Returns:
    • box

      @Deprecated(forRemoval=true) public static String box(String unboxedName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use SymTypeRelations
      Boxing 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: SymTypeExpression
      Am I primitive? (such as "int") (default: no)
      Overrides:
      isPrimitive in class SymTypeExpression
    • asPrimitive

      public SymTypePrimitive asPrimitive()
      Overrides:
      asPrimitive in class SymTypeExpression
    • deepEquals

      public boolean deepEquals(SymTypeExpression sym)
      Specified by:
      deepEquals in class SymTypeExpression
    • accept

      public void accept(ISymTypeVisitor visitor)
      Overrides:
      accept in class SymTypeExpression