Enum Class StackSize

java.lang.Object
java.lang.Enum<StackSize>
net.bytebuddy.implementation.bytecode.StackSize
All Implemented Interfaces:
Serializable, Comparable<StackSize>, Constable

public enum StackSize extends Enum<StackSize>
Represents the size of a Java type on the operand stack.
  • Enum Constant Details

    • ZERO

      public static final StackSize ZERO
      An empty stack size.
    • SINGLE

      public static final StackSize SINGLE
      A single slot stack size.
    • DOUBLE

      public static final StackSize DOUBLE
      A double slot stack size which is required by long and double values.
  • Field Details

    • size

      private final int size
      The 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

      public static StackSize[] values()
      Returns 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
    • valueOf

      public static StackSize valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • of

      public static StackSize of(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 a StackSize.
      Parameters:
      size - The size to represent. Must be 0, 1 or 2.
      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(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 a StackManipulation.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 a StackManipulation.Size that describes a stack decrease of this size.
      Returns:
      A stack size decrease by the size represented by this stack size.
    • maximum

      public StackSize maximum(StackSize stackSize)
      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.