Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

Method Class Reference

Inheritance diagram for Method:
[legend]
Collaboration diagram for Method:
[legend]
List of all members.

Public Methods

 Method ()
 Method (int access_flags, int name_index, int signature_index, Attribute[] attributes, ConstantPool constant_pool)
 Method (Method c)
void accept (Visitor v)
final Method copy (ConstantPool constant_pool)
final Code getCode ()
final ExceptionTable getExceptionTable ()
final String toString ()
 Method ()
 Method (int access_flags, int name_index, int signature_index, Attribute[] attributes, ConstantPool constant_pool)
 Method (Method c)
void accept (Visitor v)
final Method copy (ConstantPool constant_pool)
final Code getCode ()
final ExceptionTable getExceptionTable ()
final String toString ()
 Method (Name name) throws InvalidNameException
void addException (ClassOrInterfaceType exceptionType) throws AlreadyDeclaredException, ClassOrInterfaceTypeNotFoundException
void addParameterVariable (Variable variable) throws AlreadyDeclaredException
boolean areValidModifiers (int modifiers)
ClassOrInterfaceType getDeclaringClassOrInterface () throws NotDeclaredException
Enumeration getExceptions ()
int getModifiers ()
Name getName ()
Vector getParameters ()
Vector getParameterTypes ()
Type getReturnType ()
Type getType ()
boolean hasSameSignature (Method otherMethod)
boolean hasSignature (Name name, Vector parameterTypes)
boolean isAccessible (ClassOrInterfaceType otherType)
boolean isApplicable (Vector argumentTypes)
boolean isMoreSpecific (Method otherMethod)
void setDeclaringClassOrInterface (ClassOrInterfaceType classOrInterface)
void setModifiers (int modifiers) throws InvalidModifiersException
void setReturnType (Type type)
String toString ()

Static Public Methods

boolean areValidClassMethodModifiers (int modifiers)
boolean areValidInterfaceMethodModifiers (int modifiers)
boolean areValidModifiers (int modifiers, boolean isInterface)

Private Methods

 Method (DataInputStream file, ConstantPool constant_pool) throws IOException, ClassFormatError
 Method (DataInputStream file, ConstantPool constant_pool) throws IOException, ClassFormatError

Private Attributes

int modifiers = 0
Type returnType = null
Name name
Vector parameters = new Vector()
Vector parameterTypes = new Vector()
Vector exceptions = new Vector()
ClassOrInterfaceType declaringClassOrInterface = null

Detailed Description

This class represents the method info structure, i.e. the representation for a method in the class. See JVM specification for details. A method has access flags, a name, a signature and a number of attributes.

Version:
Id:
Method.java,v 1.1.1.1 2002/01/24 03:44:00 pserver Exp
Author:
M. Dahm

Definition at line 13 of file lib/jpf/de/fub/bytecode/classfile/Method.java.


Constructor & Destructor Documentation

Method::Method   [inline]
 

Empty constructor, all attributes have to be defined via `setXXX' methods. Use at your own risk.

Definition at line 18 of file lib/jpf/de/fub/bytecode/classfile/Method.java.

Method::Method int   access_flags,
int   name_index,
int   signature_index,
Attribute   attributes[],
ConstantPool   constant_pool
[inline]
 

Parameters:
access_flags   Access rights of method
name_index   Points to field name in constant pool
signature_index   Points to encoded signature
attributes   Collection of attributes
constant_pool   Array of constants

Definition at line 26 of file lib/jpf/de/fub/bytecode/classfile/Method.java.

Method::Method Method   c [inline]
 

Initialize from another object. Note that both objects use the same references (shallow copy). Use clone() for a physical copy.

Definition at line 35 of file lib/jpf/de/fub/bytecode/classfile/Method.java.

Method::Method DataInputStream   file,
ConstantPool   constant_pool
[inline, private]
 

Construct object from file stream.

Parameters:
file   Input stream
Exceptions:
IOException  
ClassFormatError  

Definition at line 44 of file lib/jpf/de/fub/bytecode/classfile/Method.java.

Method::Method   [inline]
 

Empty constructor, all attributes have to be defined via `setXXX' methods. Use at your own risk.

Definition at line 19 of file src/de/fub/bytecode/classfile/Method.java.

Method::Method int   access_flags,
int   name_index,
int   signature_index,
Attribute   attributes[],
ConstantPool   constant_pool
[inline]
 

Parameters:
access_flags   Access rights of method
name_index   Points to field name in constant pool
signature_index   Points to encoded signature
attributes   Collection of attributes
constant_pool   Array of constants

Definition at line 27 of file src/de/fub/bytecode/classfile/Method.java.

Method::Method Method   c [inline]
 

Initialize from another object. Note that both objects use the same references (shallow copy). Use clone() for a physical copy.

Definition at line 36 of file src/de/fub/bytecode/classfile/Method.java.

Method::Method DataInputStream   file,
ConstantPool   constant_pool
[inline, private]
 

Construct object from file stream.

Parameters:
file   Input stream
Exceptions:
IOException  
ClassFormatError  

Definition at line 45 of file src/de/fub/bytecode/classfile/Method.java.

Method::Method Name   name [inline]
 

Parameters:
name   edu.ksu.cis.bandera.jjjc.symboltable.Name

Definition at line 51 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Method.java.


Member Function Documentation

void Method::accept Visitor   v [inline, virtual]
 

Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.

Parameters:
v   Visitor object

Reimplemented from Instruction.

Definition at line 57 of file src/de/fub/bytecode/classfile/Method.java.

void Method::accept Visitor   v [inline, virtual]
 

Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.

Parameters:
v   Visitor object

Reimplemented from Instruction.

Definition at line 56 of file lib/jpf/de/fub/bytecode/classfile/Method.java.

void Method::addException ClassOrInterfaceType   exceptionType [inline]
 

Parameters:
exceptionType   edu.ksu.cis.bandera.jjjc.symboltable.ClassOrInterfaceType

Definition at line 60 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Method.java.

void Method::addParameterVariable Variable   variable [inline]
 

Parameters:
variable   edu.ksu.cis.bandera.jjjc.symboltable.Variable

Definition at line 80 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Method.java.

boolean Method::areValidClassMethodModifiers int   modifiers [inline, static]
 

Returns:
boolean
Parameters:
modifiers   int

Definition at line 97 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Method.java.

boolean Method::areValidInterfaceMethodModifiers int   modifiers [inline, static]
 

Returns:
boolean
Parameters:
modifiers   int

Definition at line 116 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Method.java.

boolean Method::areValidModifiers int   modifiers,
boolean   isInterface
[inline, static]
 

Returns:
boolean
Parameters:
modifiers   int
isInterface   boolean

Definition at line 137 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Method.java.

boolean Method::areValidModifiers int   modifiers [inline]
 

Returns:
boolean
Parameters:
modifiers   int

Definition at line 128 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Method.java.

final Method Method::copy ConstantPool   constant_pool [inline]
 

Returns:
deep copy of this method

Definition at line 63 of file src/de/fub/bytecode/classfile/Method.java.

final Method Method::copy ConstantPool   constant_pool [inline]
 

Returns:
deep copy of this method

Definition at line 62 of file lib/jpf/de/fub/bytecode/classfile/Method.java.

final Code Method::getCode   [inline]
 

Returns:
Code attribute of method, if any

Definition at line 69 of file src/de/fub/bytecode/classfile/Method.java.

final Code Method::getCode   [inline]
 

Returns:
Code attribute of method, if any

Definition at line 68 of file lib/jpf/de/fub/bytecode/classfile/Method.java.

Referenced by MethodGen::MethodGen(), MethodInfo::loadCode(), MethodInfo::loadExceptions(), MethodInfo::loadLineNumbers(), MethodInfo::loadLocalVariableNames(), and MethodInfo::loadLocalVariableTypes().

ClassOrInterfaceType Method::getDeclaringClassOrInterface   [inline]
 

Returns:
edu.ksu.cis.bandera.jjjc.symboltable.ClassOrInterfaceType

Definition at line 144 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Method.java.

Referenced by CodeBrowserPane::getHierTree().

final ExceptionTable Method::getExceptionTable   [inline]
 

Returns:
ExceptionTable attribute of method, if any, i.e., list all exceptions the method may throw not exception handlers!

Definition at line 80 of file src/de/fub/bytecode/classfile/Method.java.

final ExceptionTable Method::getExceptionTable   [inline]
 

Returns:
ExceptionTable attribute of method, if any, i.e. list all exceptions the method may throw not exception handlers!

Definition at line 79 of file lib/jpf/de/fub/bytecode/classfile/Method.java.

Enumeration Method::getExceptions   [inline]
 

Returns:
java.util.Enumeration

Definition at line 153 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Method.java.

int Method::getModifiers   [inline]
 

Returns:
int

Definition at line 160 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Method.java.

Name Method::getName   [inline]
 

Returns:
edu.ksu.cis.bandera.jjjc.symboltable.Name

Reimplemented from FieldOrMethod.

Definition at line 167 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Method.java.

Referenced by MethodGen::MethodGen(), MethodInfo::MethodInfo(), ClassGen::containsMethod(), and CodeHTML::writeMethod().

Vector Method::getParameterTypes   [inline]
 

Returns:
java.util.Vector

Definition at line 181 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Method.java.

Vector Method::getParameters   [inline]
 

Returns:
java.util.Vector

Definition at line 174 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Method.java.

Referenced by CodeBrowserPane::getHierTree().

Type Method::getReturnType   [inline]
 

Returns:
edu.ksu.cis.bandera.jjjc.symboltable.Type

Definition at line 188 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Method.java.

Type Method::getType   [inline]
 

Returns:
edu.ksu.cis.bandera.jjjc.symboltable.Type

Definition at line 195 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Method.java.

boolean Method::hasSameSignature Method   otherMethod [inline]
 

Returns:
boolean
Parameters:
otherMethod   edu.ksu.cis.bandera.jjjc.symboltable.Method

Definition at line 203 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Method.java.

boolean Method::hasSignature Name   name,
Vector   parameterTypes
[inline]
 

Returns:
boolean
Parameters:
name   edu.ksu.cis.bandera.jjjc.symboltable.Name
parameterTypes   java.util.Vector

Definition at line 215 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Method.java.

boolean Method::isAccessible ClassOrInterfaceType   otherType [inline]
 

Returns:
boolean
Parameters:
otherType   edu.ksu.cis.bandera.jjjc.symboltable.ClassOrInterfaceType

Definition at line 235 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Method.java.

boolean Method::isApplicable Vector   argumentTypes [inline]
 

Returns:
boolean
Parameters:
argumentTypes   java.util.Vector

Definition at line 254 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Method.java.

Referenced by isMoreSpecific().

boolean Method::isMoreSpecific Method   otherMethod [inline]
 

Returns:
boolean
Parameters:
otherMethod   edu.ksu.cis.bandera.jjjc.symboltable.Method

Definition at line 270 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Method.java.

void Method::setDeclaringClassOrInterface ClassOrInterfaceType   classOrInterface [inline]
 

Parameters:
classOrInterface   edu.ksu.cis.bandera.jjjc.symboltable.ClassOrInterfaceType

Definition at line 278 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Method.java.

void Method::setModifiers int   modifiers [inline]
 

Parameters:
modifiers   int

Definition at line 285 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Method.java.

void Method::setReturnType Type   type [inline]
 

Parameters:
type   edu.ksu.cis.bandera.jjjc.symboltable.Type

Definition at line 296 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Method.java.

String Method::toString   [inline]
 

Returns:
java.lang.String

Reimplemented from Instruction.

Definition at line 303 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Method.java.

final String Method::toString   [inline]
 

Return string representation close to declaration format, `public static int main(String[]) throws IOException', e.g.

Returns:
String representation of the method.

Reimplemented from Instruction.

Definition at line 93 of file src/de/fub/bytecode/classfile/Method.java.

final String Method::toString   [inline]
 

Return string representation close to declaration format, `public static int main(String[]) throws IOException', e.g.

Returns:
String representation of the method.

Reimplemented from Instruction.

Definition at line 92 of file lib/jpf/de/fub/bytecode/classfile/Method.java.


Member Data Documentation

Name Method::name [private]
 

Name of this instruction.

See also:
Instruction::toString

Reimplemented from Instruction.

Definition at line 42 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Method.java.


The documentation for this class was generated from the following files:
Generated at Thu Feb 7 07:20:02 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001