Package EDU.purdue.cs.bloat.reflect
Class Catch
- java.lang.Object
-
- EDU.purdue.cs.bloat.reflect.Catch
-
public class Catch extends java.lang.ObjectCatch 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 intcatchTypeIndex()Get the index into the constant pool of the type of exception to catch.java.lang.Objectclone()intendPC()Get the end PC of the protected block.inthandlerPC()Get 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.java.lang.StringtoString()Returns a string representation of the catch information.
-
-
-
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:
clonein classjava.lang.Object
-
toString
public java.lang.String toString()
Returns a string representation of the catch information.- Overrides:
toStringin classjava.lang.Object
-
-