Class AttCode

All Implemented Interfaces:
Attribute

public final class AttCode extends BaseAttribute
Attribute class for standard Code attributes.
  • Field Details

    • ATTRIBUTE_NAME

      public static final String ATTRIBUTE_NAME
      non-null; attribute name for attributes of this type
      See Also:
  • Constructor Details

    • AttCode

      public AttCode(int maxStack, int maxLocals, BytecodeArray code, ByteCatchList catches, AttributeList attributes)
      Constructs an instance.
      Parameters:
      maxStack - >= 0; the stack size
      maxLocals - >= 0; the number of locals
      code - non-null; array containing the bytecode per se
      catches - non-null; the exception table
      attributes - non-null; the associated list of attributes
  • Method Details

    • byteLength

      public int byteLength()
      Description copied from interface: Attribute
      Get the total length of the attribute in bytes, including the header. Since the header is always six bytes, the result of this method is always at least 6.
      Returns:
      >= 6; the total length, in bytes
    • getMaxStack

      public int getMaxStack()
      Gets the maximum stack size.
      Returns:
      >= 0; the maximum stack size
    • getMaxLocals

      public int getMaxLocals()
      Gets the number of locals.
      Returns:
      >= 0; the number of locals
    • getCode

      public BytecodeArray getCode()
      Gets the bytecode array.
      Returns:
      non-null; the bytecode array
    • getCatches

      public ByteCatchList getCatches()
      Gets the exception table.
      Returns:
      non-null; the exception table
    • getAttributes

      public AttributeList getAttributes()
      Gets the associated attribute list.
      Returns:
      non-null; the attribute list