Class Catch


  • public class Catch
    extends java.lang.Object
    Catch stores information about a protected block and an exception handler in a method. The startPC, endPC, and handlerPC are indices into the bytecode of the method where the protected block begins and ends and the catch block begins, respectively. They are indices into the code array.
    See Also:
    Code.code
    • Constructor Summary

      Constructors 
      Constructor Description
      Catch​(int startPC, int endPC, int handlerPC, int catchType)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int catchTypeIndex()
      Get the index into the constant pool of the type of exception to catch.
      java.lang.Object clone()  
      int endPC()
      Get the end PC of the protected block.
      int handlerPC()
      Get the start PC of the exception handler.
      void setCatchTypeIndex​(int index)
      Set the index into the constant pool of the type of exception to catch.
      void setEndPC​(int pc)
      Set the end PC of the protected block.
      void setHandlerPC​(int pc)
      Set the start PC of the exception handler.
      void setStartPC​(int pc)
      Set the start PC of the protected block.
      int startPC()
      Get the start PC of the protected block.
      java.lang.String toString()
      Returns a string representation of the catch information.
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Catch

        public Catch​(int startPC,
                     int endPC,
                     int handlerPC,
                     int catchType)
        Constructor.
        Parameters:
        startPC - The start PC of the protected block.
        endPC - The PC of the instruction after the end of the protected block.
        handlerPC - The start PC of the exception handler.
        catchType - The type of exception to catch.
    • Method Detail

      • startPC

        public int startPC()
        Get the start PC of the protected block.
        Returns:
        The start PC of the protected block.
        See Also:
        setStartPC(int)
      • setStartPC

        public void setStartPC​(int pc)
        Set the start PC of the protected block.
        Parameters:
        pc - The start PC of the protected block.
        See Also:
        startPC
      • endPC

        public int endPC()
        Get the end PC of the protected block.
        Returns:
        The PC of the instruction after the end of the protected block.
        See Also:
        setEndPC(int)
      • setEndPC

        public void setEndPC​(int pc)
        Set the end PC of the protected block.
        Parameters:
        pc - The PC of the instruction after the end of the protected block.
        See Also:
        endPC
      • handlerPC

        public int handlerPC()
        Get the start PC of the exception handler.
        Returns:
        The start PC of the exception handler.
        See Also:
        setHandlerPC(int)
      • setHandlerPC

        public void setHandlerPC​(int pc)
        Set the start PC of the exception handler.
        Parameters:
        pc - The start PC of the exception handler.
        See Also:
        handlerPC
      • catchTypeIndex

        public int catchTypeIndex()
        Get the index into the constant pool of the type of exception to catch.
        Returns:
        Index of the type of exception to catch.
        See Also:
        setCatchTypeIndex(int)
      • setCatchTypeIndex

        public void setCatchTypeIndex​(int index)
        Set the index into the constant pool of the type of exception to catch.
        Parameters:
        index - Index of the type of exception to catch.
        See Also:
        catchTypeIndex()
      • clone

        public java.lang.Object clone()
        Overrides:
        clone in class java.lang.Object
      • toString

        public java.lang.String toString()
        Returns a string representation of the catch information.
        Overrides:
        toString in class java.lang.Object