Enum StackSize
- All Implemented Interfaces:
Serializable
,Comparable<StackSize>
,java.lang.constant.Constable
Represents the size of a Java type on the operand stack.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
The size of the stack this instance represents. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
getSize()
The numeric value of this stack size representation.Determines the maximum of two stack size representations.static StackSize
of
(int size) Represents a numeric size as aStackSize
.static StackSize
Finds the operand stack size of a given Java type.static int
of
(Collection<? extends TypeDefinition> typeDefinitions) Computes the stack size of all supplied types.static int
of
(TypeDefinition... typeDefinition) Computes the stack size of all supplied types.Creates an instance of aStackManipulation.Size
that describes a stack decrease of this size.Creates an instance of aStackManipulation.Size
that describes a stack growth of this size.static StackSize
Returns the enum constant of this type with the specified name.static StackSize[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
ZERO
An empty stack size. -
SINGLE
A single slot stack size. -
DOUBLE
A double slot stack size which is required bylong
anddouble
values.
-
-
Field Details
-
size
private final int sizeThe size of the stack this instance represents.
-
-
Constructor Details
-
StackSize
private StackSize(int size) Creates a new stack size.- Parameters:
size
- The size of the stack this instance represents.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
of
Finds the operand stack size of a given Java type.- Parameters:
type
- The type of interest.- Returns:
- The given type's operand stack size.
-
of
Represents a numeric size as aStackSize
.- Parameters:
size
- The size to represent. Must be0
,1
or2
.- Returns:
- A stack size representation for the given value.
-
of
Computes the stack size of all supplied types.- Parameters:
typeDefinition
- The types for which to compute the size.- Returns:
- The total size of all types.
-
of
Computes the stack size of all supplied types.- Parameters:
typeDefinitions
- The types for which to compute the size.- Returns:
- The total size of all types.
-
getSize
public int getSize()The numeric value of this stack size representation.- Returns:
- An integer representing the operand stack size.
-
toIncreasingSize
Creates an instance of aStackManipulation.Size
that describes a stack growth of this size.- Returns:
- A stack size growth by the size represented by this stack size.
-
toDecreasingSize
Creates an instance of aStackManipulation.Size
that describes a stack decrease of this size.- Returns:
- A stack size decrease by the size represented by this stack size.
-
maximum
Determines the maximum of two stack size representations.- Parameters:
stackSize
- The other stack size representation.- Returns:
- The maximum of this and the other stack size.
-