Enum StackSize
- java.lang.Object
-
- java.lang.Enum<StackSize>
-
- net.bytebuddy.implementation.bytecode.StackSize
-
-
Field Summary
Fields Modifier and Type Field Description private int
size
The size of the stack this instance represents.
-
Constructor Summary
Constructors Modifier Constructor Description private
StackSize(int size)
Creates a new stack size.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getSize()
The numeric value of this stack size representation.StackSize
maximum(StackSize stackSize)
Determines the maximum of two stack size representations.static StackSize
of(int size)
Represents a numeric size as aStackSize
.static StackSize
of(java.lang.Class<?> type)
Finds the operand stack size of a given Java type.static int
of(java.util.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.StackManipulation.Size
toDecreasingSize()
Creates an instance of aStackManipulation.Size
that describes a stack decrease of this size.StackManipulation.Size
toIncreasingSize()
Creates an instance of aStackManipulation.Size
that describes a stack growth of this size.static StackSize
valueOf(java.lang.String name)
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.
-
-
-
Method Detail
-
values
public static StackSize[] 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 (StackSize c : StackSize.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static StackSize 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 namejava.lang.NullPointerException
- if the argument is null
-
of
public static StackSize of(java.lang.Class<?> type)
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
public static StackSize of(int size)
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
public static int of(TypeDefinition... typeDefinition)
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
public static int of(java.util.Collection<? extends TypeDefinition> typeDefinitions)
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
public StackManipulation.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
public StackManipulation.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.
-
-