Enum JavaType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<JavaType>

    public enum JavaType
    extends java.lang.Enum<JavaType>
      B   byte       signed byte
      C   char       Unicode character code point in the Basic Multilingual Plane,
                     encoded with UTF-16
      D   double     double-precision floating-point value
      F   float      single-precision floating-point value
      I   int        integer
      J   long       long integer
      L ClassName ;  reference             an instance of class ClassName
      S   short      signed short
      Z   boolean    true or false
      [   reference  one array dimension
     
    https://stackoverflow.com/questions/32768036/why-is-l-the-prefix-for-reference-types-instead-of-some-other-letter
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      BOOLEAN  
      BYTE  
      CHAR  
      DOUBLE  
      FLOAT  
      INT  
      LONG  
      REFERENCE
      4 bytes with 32-bit JVM or 64-bit JVM with compressed pointers (All JVM:s assigned less than 32GB)
      SHORT  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private JavaType​(java.lang.Class<?> aClass, int informationBits, long memoryBytes)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long estimateSizeOfWrapperClass()  
      (package private) int getInformationBits()  
      java.lang.Class<?> getJavaClass()  
      static JavaType match​(java.lang.Class<?> aClass)  
      long memory()  
      static JavaType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static JavaType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • BOOLEAN

        public static final JavaType BOOLEAN
      • BYTE

        public static final JavaType BYTE
      • CHAR

        public static final JavaType CHAR
      • DOUBLE

        public static final JavaType DOUBLE
      • FLOAT

        public static final JavaType FLOAT
      • LONG

        public static final JavaType LONG
      • REFERENCE

        public static final JavaType REFERENCE
        4 bytes with 32-bit JVM or 64-bit JVM with compressed pointers (All JVM:s assigned less than 32GB)
      • SHORT

        public static final JavaType SHORT
    • Field Detail

      • myInformationBits

        private final int myInformationBits
      • myJavaClass

        private final java.lang.Class<?> myJavaClass
      • myMemoryBytes

        private final long myMemoryBytes
    • Constructor Detail

      • JavaType

        private JavaType​(java.lang.Class<?> aClass,
                         int informationBits,
                         long memoryBytes)
    • Method Detail

      • values

        public static JavaType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (JavaType c : JavaType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static JavaType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • match

        public static final JavaType match​(java.lang.Class<?> aClass)
      • estimateSizeOfWrapperClass

        public final long estimateSizeOfWrapperClass()
      • getJavaClass

        public java.lang.Class<?> getJavaClass()
      • memory

        public final long memory()
      • getInformationBits

        final int getInformationBits()