edu.rit.classfile
Class SubroutineDescription

java.lang.Object
  extended by edu.rit.classfile.SubroutineReference
      extended by edu.rit.classfile.SubroutineDescription
Direct Known Subclasses:
SynthesizedSubroutineDescription

public abstract class SubroutineDescription
extends SubroutineReference

Class SubroutineDescription encapsulates the information needed to refer to or to describe a subroutine (method, constructor, or class initializer). This includes the class, method name, return type, argument types, access flags, thrown exceptions, instructions, and exception handlers. In the documentation below, the term "described subroutine" means "the subroutine described by this subroutine description object."


Method Summary
 int getCodeLength()
          Returns the described subroutine's code length.
 List getExceptionHandlers()
          Returns a list of the described subroutine's exception handlers.
 List getInstructions()
          Returns a list of the described subroutine's bytecode instructions.
 int getMaxLocals()
          Returns the described subroutine's max_locals item.
 int getMaxStack()
          Returns the described subroutine's max_stack item.
 List getThrownExceptions()
          Returns a list of the exception classes the described subroutine is declared to throw.
 boolean isAbstract()
          Returns true if the described subroutine is abstract, that is, no implementation is provided.
 boolean isFinal()
          Returns true if the described subroutine is final, that is, may not be overridden.
 boolean isNative()
          Returns true if the described subroutine is native, that is, implemented in a language other than Java.
 boolean isPackageScoped()
          Returns true if the described subroutine has default access (also known as package scoped), that is, may be accessed only from inside its defining package or inside its defining class.
 boolean isPrivate()
          Returns true if the described subroutine is private, that is, may be accessed only from inside its defining class.
 boolean isProtected()
          Returns true if the described subroutine is protected, that is, may be accessed only from inside its defining package, inside its defining class, or inside subclasses of its defining class.
 boolean isPublic()
          Returns true if the described subroutine is public, that is, may be accessed from inside and outside its defining package.
 boolean isStatic()
          Returns true if the described subroutine is static.
 boolean isStrictfp()
          Returns true if the described subroutine uses strict floating point mode.
 boolean isSynchronized()
          Returns true if the described subroutine is synchronized, that is, the monitor must be locked upon invocation and unlocked upon return.
 
Methods inherited from class edu.rit.classfile.SubroutineReference
equals, getArgumentTypes, getArgumentWordCount, getClassReference, getMethodDescriptor, getMethodName, getReturnType, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

isPublic

public boolean isPublic()
Returns true if the described subroutine is public, that is, may be accessed from inside and outside its defining package.


isPrivate

public boolean isPrivate()
Returns true if the described subroutine is private, that is, may be accessed only from inside its defining class.


isProtected

public boolean isProtected()
Returns true if the described subroutine is protected, that is, may be accessed only from inside its defining package, inside its defining class, or inside subclasses of its defining class.


isPackageScoped

public boolean isPackageScoped()
Returns true if the described subroutine has default access (also known as package scoped), that is, may be accessed only from inside its defining package or inside its defining class.


isStatic

public boolean isStatic()
Returns true if the described subroutine is static.


isFinal

public boolean isFinal()
Returns true if the described subroutine is final, that is, may not be overridden.


isSynchronized

public boolean isSynchronized()
Returns true if the described subroutine is synchronized, that is, the monitor must be locked upon invocation and unlocked upon return.


isNative

public boolean isNative()
Returns true if the described subroutine is native, that is, implemented in a language other than Java.


isAbstract

public boolean isAbstract()
Returns true if the described subroutine is abstract, that is, no implementation is provided.


isStrictfp

public boolean isStrictfp()
Returns true if the described subroutine uses strict floating point mode.


getThrownExceptions

public List getThrownExceptions()
Returns a list of the exception classes the described subroutine is declared to throw. The returned list is unmodifiable. Each item in the list is an instance of class ClassReference. The exceptions appear in the list in the order they were declared. If the subroutine is declared to throw no exceptions, the returned list's size is zero.


getMaxStack

public int getMaxStack()
Returns the described subroutine's max_stack item. The max_stack item's value gives the maximum depth of the described subroutine's operand stack at any point during execution of the subroutine.


getMaxLocals

public int getMaxLocals()
Returns the described subroutine's max_locals item. The max_locals item's value gives the number of local variables in the local variable array allocated upon invocation of the described subroutine, including the local variables used to pass the this reference if any and arguments if any to the subroutine on its invocation.


getInstructions

public List getInstructions()
Returns a list of the described subroutine's bytecode instructions. The returned list is unmodifiable. Each item in the list is an instance of class Instruction. The instructions appear in the list in the order they were added.


getCodeLength

public int getCodeLength()
Returns the described subroutine's code length. This is the number of bytes occupied by the described subroutine's bytecode instructions.


getExceptionHandlers

public List getExceptionHandlers()
Returns a list of the described subroutine's exception handlers. The returned list is unmodifiable. Each item in the list is an instance of class ExceptionHandler. The exception handlers appear in the list in the order they were added.



Copyright © 2001-2006 by Alan Kaminsky. All rights reserved. Send comments to ark­@­cs.rit.edu.