Enum Class TypeKind
- All Implemented Interfaces:
- Serializable,- Comparable<TypeKind>,- Constable
Describes the data types Java Virtual Machine operates on.  This omits 
 returnAddress (JVMS 2.3.3) and includes void (JVMS
 4.3.3), which appears as a method return type.
 
 The returnAddress type is only used by discontinued
 jump subroutine and
 return from subroutine
 instructions.  Jump subroutine instructions push returnAddress to the
 operand stack; astore instructions store 
 returnAddress from the operand stack to local variables; return from
 subroutine instructions load returnAddress from local variables.
 
Computational Type
In theclass file format, local variables (JVMS 2.6.1),
 and the operand stack (JVMS 2.6.2) of the Java Virtual Machine,
 boolean, byte, char,
 short types do not exist and are represented by the int computational type.
 int, float, reference,
 returnAddress, long, and doule
 are the computational types of the Java Virtual Machine.- See Java Virtual Machine Specification:
- 
2.2 Data Types
 2.11.1 Types and the Java Virtual Machine
- Since:
- 24
- 
Nested Class SummaryNested classes/interfaces declared in class java.lang.EnumEnum.EnumDesc<E extends Enum<E>>
- 
Enum Constant SummaryEnum ConstantsEnum ConstantDescriptionThe primitive typeboolean.The primitive typebyte.The primitive typechar.The primitive typedouble.The primitive typefloat.The primitive typeint.The primitive typelong.A reference type.The primitive typeshort.Thevoidtype, for absence of a value.
- 
Method SummaryModifier and TypeMethodDescriptionstatic TypeKindfrom(TypeDescriptor.OfField<?> descriptor) Returns the type associated with the specified field descriptor.static TypeKindReturns the type associated with the specified field descriptor.static TypeKindfromNewarrayCode(int newarrayCode) Returns the component type described by the array code used as an operand tonewarray.intReturns the code used by thenewarrayinstruction to create an array of this component type, or-1if this type is not supported bynewarray.intslotSize()Returns the number of local variable index or operand stack depth consumed by this type.Returns the most specific upper bound field descriptor that can store any value of this type.static TypeKindReturns the enum constant of this class with the specified name.static TypeKind[]values()Returns an array containing the constants of this enum class, in the order they are declared.
- 
Enum Constant Details- 
BOOLEANThe primitive typeboolean. Its computational type isint.0representsfalse, and1representstrue. It is zero-extended to anintwhen loaded onto the operand stack and narrowed by taking the bitwise AND with1when stored.- See Java Virtual Machine Specification:
- 
2.3.4 The booleanType
 
- 
BYTEThe primitive typebyte. Its computational type isint. It is sign-extended to anintwhen loaded onto the operand stack and truncated when stored.
- 
CHARThe primitive typechar. Its computational type isint. It is zero-extended to anintwhen loaded onto the operand stack and truncated when stored.
- 
SHORTThe primitive typeshort. Its computational type isint. It is sign-extended to anintwhen loaded onto the operand stack and truncated when stored.
- 
INTThe primitive typeint.
- 
LONG
- 
FLOATThe primitive typefloat. All NaN values offloatmay or may not be collapsed into a single "canonical" NaN value in loading and storing.
- 
DOUBLEThe primitive typedouble. It is of category 2. All NaN values ofdoublemay or may not be collapsed into a single "canonical" NaN value in loading and storing.
- 
REFERENCEA reference type.- See Java Virtual Machine Specification:
- 
2.4 Reference Types and Values
 
- 
VOIDThevoidtype, for absence of a value. While this is not a data type, this can be a method return type indicating no change in operand stack depth.- See Java Virtual Machine Specification:
- 
4.3.3 Method Descriptors
 
 
- 
- 
Method Details- 
valuesReturns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
 
- 
valueOfReturns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
- IllegalArgumentException- if this enum class has no constant with the specified name
- NullPointerException- if the argument is null
 
- 
upperBound
- 
newarrayCodepublic int newarrayCode()Returns the code used by thenewarrayinstruction to create an array of this component type, or-1if this type is not supported bynewarray.- Returns:
- the code used by the newarrayinstruction to create an array of this component type, or-1if this type is not supported bynewarray
- See Java Virtual Machine Specification:
- 
6.5.newarray newarray
- See Also:
 
- 
slotSizepublic int slotSize()Returns the number of local variable index or operand stack depth consumed by this type. This is also the category of this type for instructions operating on the operand stack without regard to type (JVMS 2.11.1), such aspopversuspop2.- Returns:
- the number of local variable index or operand stack depth consumed by this type
- See Java Virtual Machine Specification:
- 
2.6.1 Local Variables
 2.6.2 Operand Stacks
 
- 
asLoadable- Returns:
- the computational type for this type, or voidforvoid
- See Also:
 
- 
fromNewarrayCodeReturns the component type described by the array code used as an operand tonewarray.- Parameters:
- newarrayCode- the operand of the- newarrayinstruction
- Returns:
- the component type described by the array code used as an operand to newarray
- Throws:
- IllegalArgumentException- if the code is invalid
- See Java Virtual Machine Specification:
- 
6.5.newarray newarray
- See Also:
 
- 
fromDescriptorReturns the type associated with the specified field descriptor.- Parameters:
- s- the field descriptor
- Returns:
- the type associated with the specified field descriptor
- Throws:
- IllegalArgumentException- only if the descriptor is not valid
 
- 
fromReturns the type associated with the specified field descriptor.- Parameters:
- descriptor- the field descriptor
- Returns:
- the type associated with the specified field descriptor
 
 
-