Class PrimitiveType

java.lang.Object
mockit.asm.types.JavaType
mockit.asm.types.PrimitiveType

public final class PrimitiveType extends JavaType
  • Method Details

    • getPrimitiveType

      @Nullable public static PrimitiveType getPrimitiveType(int typeCode)
    • getCorrespondingPrimitiveTypeIfWrapperType

      @Nullable public static PrimitiveType getCorrespondingPrimitiveTypeIfWrapperType(@NonNull String typeDesc)
    • getType

      @NonNull public static Class<?> getType(int typeCode)
    • getArrayElementType

      public static int getArrayElementType(@NonNull PrimitiveType elementType)
      Maps a PrimitiveType to the corresponding ArrayElementType.
    • getTypeCode

      public char getTypeCode()
    • getType

      @NonNull public Class<?> getType()
    • getWrapperTypeDesc

      @NonNull public String getWrapperTypeDesc()
    • getClassName

      @NonNull public String getClassName()
      Description copied from class: JavaType
      Returns the binary name of the class corresponding to this type. This method must not be used on method types.
      Specified by:
      getClassName in class JavaType
    • getSize

      public @org.checkerframework.checker.index.qual.NonNegative int getSize()
      Description copied from class: JavaType
      Returns the size of values of this type. This method must not be used for method types.
      Specified by:
      getSize in class JavaType
      Returns:
      the size of values of this type, i.e., 2 for long and double, 0 for void and 1 otherwise.
    • getOpcode

      public int getOpcode(int opcode)
      Description copied from class: JavaType
      Returns a JVM instruction opcode adapted to this Java type. This method must not be used for method types.
      Specified by:
      getOpcode in class JavaType
      Parameters:
      opcode - a JVM instruction opcode. This opcode must be one of ILOAD, ISTORE, IALOAD, IASTORE, IADD, ISUB, IMUL, IDIV, IREM, INEG, ISHL, ISHR, IUSHR, IAND, IOR, IXOR and IRETURN.
      Returns:
      an opcode that is similar to the given opcode, but adapted to this Java type. For example, if this type is float and opcode is IRETURN, this method returns FRETURN.
    • getLoadOpcode

      public int getLoadOpcode()
      Specified by:
      getLoadOpcode in class JavaType
    • getConstOpcode

      public int getConstOpcode()
      Specified by:
      getConstOpcode in class JavaType
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object