Enum StackSize
- All Implemented Interfaces:
Serializable, Comparable<StackSize>, java.lang.constant.Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe size of the stack this instance represents. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetSize()The numeric value of this stack size representation.Determines the maximum of two stack size representations.static StackSizeof(int size) Represents a numeric size as aStackSize.static StackSizeFinds the operand stack size of a given Java type.static intof(Collection<? extends TypeDefinition> typeDefinitions) Computes the stack size of all supplied types.static intof(TypeDefinition... typeDefinition) Computes the stack size of all supplied types.Creates an instance of aStackManipulation.Sizethat describes a stack decrease of this size.Creates an instance of aStackManipulation.Sizethat describes a stack growth of this size.static StackSizeReturns 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 bylonganddoublevalues.
-
-
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
-
of
-
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.Sizethat 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.Sizethat describes a stack decrease of this size.- Returns:
- A stack size decrease by the size represented by this stack size.
-
maximum
-