Class Catch
java.lang.Object
EDU.purdue.cs.bloat.reflect.Catch
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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGet the index into the constant pool of the type of exception to catch.clone()intendPC()Get the end PC of the protected block.intGet the start PC of the exception handler.voidsetCatchTypeIndex(int index) Set the index into the constant pool of the type of exception to catch.voidsetEndPC(int pc) Set the end PC of the protected block.voidsetHandlerPC(int pc) Set the start PC of the exception handler.voidsetStartPC(int pc) Set the start PC of the protected block.intstartPC()Get the start PC of the protected block.toString()Returns a string representation of the catch information.
-
Constructor Details
-
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 Details
-
startPC
public int startPC()Get the start PC of the protected block.- Returns:
- The start PC of the protected block.
- See Also:
-
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:
-
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
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:
-
handlerPC
public int handlerPC()Get the start PC of the exception handler.- Returns:
- The start PC of the exception handler.
- See Also:
-
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:
-
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
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:
-
clone
-
toString
-