Class Exceptions

java.lang.Object
EDU.purdue.cs.bloat.file.Attribute
EDU.purdue.cs.bloat.file.Exceptions

public class Exceptions extends Attribute
Exceptions describes the types of exceptions that a method may throw. The Exceptions attribute stores a list of indices into the constant pool of the typs of exceptions thrown by the method.
See Also:
  • Constructor Details

    • Exceptions

      public Exceptions(ClassInfo classInfo, DataInputStream in, int nameIndex, int length) throws IOException
      Constructor. Create an Exceptions attribute from a data stream.
      Parameters:
      in - The data stream of the class file.
      nameIndex - The index into the constant pool of the name of the attribute.
      length - The length of the attribute, excluding the header.
      Throws:
      IOException - If an error occurs while reading.
  • Method Details

    • writeData

      public void writeData(DataOutputStream out) throws IOException
      Write the attribute to a data stream.
      Specified by:
      writeData in class Attribute
      Parameters:
      out - The data stream of the class file.
      Throws:
      IOException - If an error occurs while writing.
    • exceptionTypes

      public int[] exceptionTypes()
      Get the indices into the constant pool of the types of the exceptions thrown by this method.
      Returns:
      The indices of the types of the exceptions thrown.
    • length

      public int length()
      Get the length of the attribute.
      Overrides:
      length in class Attribute
    • clone

      public Object clone()
      Overrides:
      clone in class Attribute
    • toString

      public String toString()
      Returns a string representation of the attribute.
      Overrides:
      toString in class Attribute