Enum Class TypeKind
- All Implemented Interfaces:
Serializable
,Comparable<TypeKindPREVIEW>
,Constable
TypeKind
is a preview API of the Java platform.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
Describes the types that can be part of a field or method descriptor.
- Since:
- 22
-
Nested Class Summary
Nested classes/interfaces declared in class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionthe primitive type booleanthe primitive type bytethe primitive type charthe primitive type doublethe primitive type floatthe primitive type intthe primitive type longa reference typethe primitive type shortvoid -
Method Summary
Modifier and TypeMethodDescriptionErase this type kind to the type which will be used for xLOAD, xSTORE, and xRETURN bytecodesReturns the field descriptor character corresponding to this type.from
(TypeDescriptor.OfField<?> descriptor) Returns the type kind associated with the specified field descriptor.Returns the type kind associated with the specified field descriptor.fromNewArrayCode
(int newarraycode) Returns the type kind associated with the array type described by the array code used as an operand tonewarray
.int
Returns the code used by thenewarray
opcode corresponding to this type.int
slotSize()
Returns the number of local variable slots consumed by this type.typeName()
Returns the human-readable name corresponding to this type.Returns the enum constant of this class with the specified name.values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ByteType
-
ShortType
-
IntType
-
FloatType
-
LongType
-
DoubleType
-
ReferenceType
-
CharType
-
BooleanType
-
VoidType
-
-
Method Details
-
values
-
valueOf
Returns 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 nameNullPointerException
- if the argument is null
-
typeName
Returns the human-readable name corresponding to this type.- Returns:
- the human-readable name corresponding to this type
-
descriptor
Returns the field descriptor character corresponding to this type.- Returns:
- the field descriptor character corresponding to this type
-
newarraycode
public int newarraycode()Returns the code used by thenewarray
opcode corresponding to this type.- Returns:
- the code used by the
newarray
opcode corresponding to this type
-
slotSize
public int slotSize()Returns the number of local variable slots consumed by this type.- Returns:
- the number of local variable slots consumed by this type
-
asLoadable
-
fromNewArrayCode
Returns the type kind associated with the array type described by the array code used as an operand tonewarray
.- Parameters:
newarraycode
- the operand of thenewarray
instruction- Returns:
- the type kind associated with the array type described by the
array code used as an operand to
newarray
-
fromDescriptor
Returns the type kind associated with the specified field descriptor.- Parameters:
s
- the field descriptor- Returns:
- the type kind associated with the specified field descriptor
-
from
Returns the type kind associated with the specified field descriptor.- Parameters:
descriptor
- the field descriptor- Returns:
- the type kind associated with the specified field descriptor
-
TypeKind
when preview features are enabled.