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

Code Class Reference

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

Public Methods

 Code (int name_index, int length, int max_stack, int max_locals, byte[] code, CodeException[] exception_table, Attribute[] attributes, ConstantPool constant_pool)
 Code (Code c)
void accept (Visitor v)
Attribute copy (ConstantPool constant_pool)
final void dump (DataOutputStream file) throws IOException
final Attribute[] getAttributes ()
final byte[] getCode ()
final CodeException[] getExceptionTable ()
LineNumberTable getLineNumberTable ()
LocalVariableTable getLocalVariableTable ()
final int getMaxLocals ()
final int getMaxStack ()
final void setAttributes (Attribute[] attributes)
final void setCode (byte[] code)
final void setExceptionTable (CodeException[] exception_table)
final void setMaxLocals (int max_locals)
final void setMaxStack (int max_stack)
final String toString ()
final String toString (boolean verbose)
 Code (int name_index, int length, int max_stack, int max_locals, byte[] code, CodeException[] exception_table, Attribute[] attributes, ConstantPool constant_pool)
 Code (Code c)
void accept (Visitor v)
Attribute copy (ConstantPool constant_pool)
final void dump (DataOutputStream file) throws IOException
final Attribute[] getAttributes ()
final byte[] getCode ()
final CodeException[] getExceptionTable ()
LineNumberTable getLineNumberTable ()
LocalVariableTable getLocalVariableTable ()
final int getMaxLocals ()
final int getMaxStack ()
final void setAttributes (Attribute[] attributes)
final void setCode (byte[] code)
final void setExceptionTable (CodeException[] exception_table)
final void setMaxLocals (int max_locals)
final void setMaxStack (int max_stack)
final String toString ()
final String toString (boolean verbose)

Private Methods

 Code (int name_index, int length, DataInputStream file, ConstantPool constant_pool) throws IOException
final int calculateLength ()
final int getInternalLength ()
 Code (int name_index, int length, DataInputStream file, ConstantPool constant_pool) throws IOException
final int calculateLength ()
final int getInternalLength ()

Private Attributes

int max_stack
int max_locals
int code_length
byte[] code
int exception_table_length
CodeException[] exception_table
int attributes_count
Attribute[] attributes
byte[] code
CodeException[] exception_table
Attribute[] attributes

Detailed Description

This class is derived from Attribute and represents a code chunk. It is instantiated by the Attribute.readAttribute() method. A Code attribute contains informations about operand stack, local variables, byte code and the exceptions handled within this method.

This attribute has attributes itself, namely LineNumberTable which is used for debugging purposes and LocalVariableTable which contains information about the local variables.

Version:
Id:
Code.java,v 1.1.1.1 2002/01/24 03:44:00 pserver Exp
Author:
M. Dahm
See also:
Attribute , CodeException , LineNumberTable , LocalVariableTable

Definition at line 24 of file lib/jpf/de/fub/bytecode/classfile/Code.java.


Constructor & Destructor Documentation

Code::Code int   name_index,
int   length,
int   max_stack,
int   max_locals,
byte   code[],
CodeException   exception_table[],
Attribute   attributes[],
ConstantPool   constant_pool
[inline]
 

Parameters:
name_index   Index pointing to the name Code
length   Content length in bytes
max_stack   Maximum size of stack
max_locals   Number of local variables
code   Actual byte code
exception_table   Table of handled exceptions
attributes   Attributes of code: LineNumber or LocalVariable
constant_pool   Array of constants

Definition at line 45 of file lib/jpf/de/fub/bytecode/classfile/Code.java.

Code::Code int   name_index,
int   length,
DataInputStream   file,
ConstantPool   constant_pool
[inline, private]
 

Parameters:
name_index   Index pointing to the name Code
length   Content length in bytes
file   Input stream
constant_pool   Array of constants

Definition at line 67 of file lib/jpf/de/fub/bytecode/classfile/Code.java.

Code::Code Code   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 107 of file lib/jpf/de/fub/bytecode/classfile/Code.java.

Code::Code int   name_index,
int   length,
int   max_stack,
int   max_locals,
byte   code[],
CodeException   exception_table[],
Attribute   attributes[],
ConstantPool   constant_pool
[inline]
 

Parameters:
name_index   Index pointing to the name Code
length   Content length in bytes
max_stack   Maximum size of stack
max_locals   Number of local variables
code   Actual byte code
exception_table   Table of handled exceptions
attributes   Attributes of code: LineNumber or LocalVariable
constant_pool   Array of constants

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

Code::Code int   name_index,
int   length,
DataInputStream   file,
ConstantPool   constant_pool
[inline, private]
 

Parameters:
name_index   Index pointing to the name Code
length   Content length in bytes
file   Input stream
constant_pool   Array of constants

Definition at line 67 of file src/de/fub/bytecode/classfile/Code.java.

Code::Code Code   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 107 of file src/de/fub/bytecode/classfile/Code.java.


Member Function Documentation

void Code::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 Attribute.

Definition at line 119 of file src/de/fub/bytecode/classfile/Code.java.

void Code::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 Attribute.

Definition at line 119 of file lib/jpf/de/fub/bytecode/classfile/Code.java.

final int Code::calculateLength   [inline, private]
 

Returns:
the full size of this code attribute, minus its first 6 bytes, including the size of all its contained attributes

Definition at line 126 of file src/de/fub/bytecode/classfile/Code.java.

final int Code::calculateLength   [inline, private]
 

Returns:
the full size of this code attribute, minus its first 6 bytes, including the size of all its contained attributes

Definition at line 126 of file lib/jpf/de/fub/bytecode/classfile/Code.java.

Attribute Code::copy ConstantPool   constant_pool [inline, virtual]
 

Returns:
deep copy of this attribute

Reimplemented from Attribute.

Definition at line 137 of file src/de/fub/bytecode/classfile/Code.java.

Attribute Code::copy ConstantPool   constant_pool [inline, virtual]
 

Returns:
deep copy of this attribute

Reimplemented from Attribute.

Definition at line 137 of file lib/jpf/de/fub/bytecode/classfile/Code.java.

final void Code::dump DataOutputStream   file [inline]
 

Dump code attribute to file stream in binary format.

Parameters:
file   Output file stream
Exceptions:
IOException  

Reimplemented from Attribute.

Definition at line 158 of file src/de/fub/bytecode/classfile/Code.java.

final void Code::dump DataOutputStream   file [inline]
 

Dump code attribute to file stream in binary format.

Parameters:
file   Output file stream
Exceptions:
IOException  

Reimplemented from Attribute.

Definition at line 158 of file lib/jpf/de/fub/bytecode/classfile/Code.java.

final Attribute [] Code::getAttributes   [inline]
 

Returns:
Collection of code attributes.
See also:
Attribute

Definition at line 179 of file src/de/fub/bytecode/classfile/Code.java.

final Attribute [] Code::getAttributes   [inline]
 

Returns:
Collection of code attributes.
See also:
Attribute

Definition at line 179 of file lib/jpf/de/fub/bytecode/classfile/Code.java.

Referenced by Code(), MethodGen::MethodGen(), and CodeHTML::writeMethod().

final byte [] Code::getCode   [inline]
 

Returns:
Actual byte code of the method.

Definition at line 183 of file src/de/fub/bytecode/classfile/Code.java.

final byte [] Code::getCode   [inline]
 

Returns:
Actual byte code of the method.

Definition at line 183 of file lib/jpf/de/fub/bytecode/classfile/Code.java.

Referenced by Code(), MethodGen::MethodGen(), and CodeHTML::writeMethod().

final CodeException [] Code::getExceptionTable   [inline]
 

Returns:
Table of handled exceptions.
See also:
CodeException

Definition at line 188 of file src/de/fub/bytecode/classfile/Code.java.

final CodeException [] Code::getExceptionTable   [inline]
 

Returns:
Table of handled exceptions.
See also:
CodeException

Definition at line 188 of file lib/jpf/de/fub/bytecode/classfile/Code.java.

Referenced by Code(), and MethodGen::MethodGen().

final int Code::getInternalLength   [inline, private]
 

Returns:
the internal length of this code attribute (minus the first 6 bytes) and excluding all its attributes

Definition at line 193 of file src/de/fub/bytecode/classfile/Code.java.

final int Code::getInternalLength   [inline, private]
 

Returns:
the internal length of this code attribute (minus the first 6 bytes) and excluding all its attributes

Definition at line 193 of file lib/jpf/de/fub/bytecode/classfile/Code.java.

LineNumberTable Code::getLineNumberTable   [inline]
 

Returns:
LineNumberTable of Code, if it has one

Definition at line 203 of file src/de/fub/bytecode/classfile/Code.java.

LineNumberTable Code::getLineNumberTable   [inline]
 

Returns:
LineNumberTable of Code, if it has one

Definition at line 203 of file lib/jpf/de/fub/bytecode/classfile/Code.java.

LocalVariableTable Code::getLocalVariableTable   [inline]
 

Returns:
LocalVariableTable of Code, if it has one

Definition at line 213 of file src/de/fub/bytecode/classfile/Code.java.

LocalVariableTable Code::getLocalVariableTable   [inline]
 

Returns:
LocalVariableTable of Code, if it has one

Definition at line 213 of file lib/jpf/de/fub/bytecode/classfile/Code.java.

final int Code::getMaxLocals   [inline]
 

Returns:
Number of local variables.

Definition at line 223 of file src/de/fub/bytecode/classfile/Code.java.

final int Code::getMaxLocals   [inline]
 

Returns:
Number of local variables.

Definition at line 223 of file lib/jpf/de/fub/bytecode/classfile/Code.java.

Referenced by Code(), and MethodGen::MethodGen().

final int Code::getMaxStack   [inline]
 

Returns:
Maximum size of stack used by this method.

Definition at line 228 of file src/de/fub/bytecode/classfile/Code.java.

final int Code::getMaxStack   [inline]
 

Returns:
Maximum size of stack used by this method.

Definition at line 228 of file lib/jpf/de/fub/bytecode/classfile/Code.java.

Referenced by Code(), and MethodGen::MethodGen().

final void Code::setAttributes Attribute   attributes[] [inline]
 

Parameters:
attributes.  

Definition at line 232 of file src/de/fub/bytecode/classfile/Code.java.

final void Code::setAttributes Attribute   attributes[] [inline]
 

Parameters:
attributes.  

Definition at line 232 of file lib/jpf/de/fub/bytecode/classfile/Code.java.

final void Code::setCode byte   code[] [inline]
 

Parameters:
code   byte code

Definition at line 240 of file src/de/fub/bytecode/classfile/Code.java.

final void Code::setCode byte   code[] [inline]
 

Parameters:
code   byte code

Definition at line 240 of file lib/jpf/de/fub/bytecode/classfile/Code.java.

final void Code::setExceptionTable CodeException   exception_table[] [inline]
 

Parameters:
exception_table   exception table

Definition at line 247 of file src/de/fub/bytecode/classfile/Code.java.

final void Code::setExceptionTable CodeException   exception_table[] [inline]
 

Parameters:
exception_table   exception table

Definition at line 247 of file lib/jpf/de/fub/bytecode/classfile/Code.java.

final void Code::setMaxLocals int   max_locals [inline]
 

Parameters:
max_locals   maximum number of local variables

Definition at line 255 of file src/de/fub/bytecode/classfile/Code.java.

final void Code::setMaxLocals int   max_locals [inline]
 

Parameters:
max_locals   maximum number of local variables

Definition at line 255 of file lib/jpf/de/fub/bytecode/classfile/Code.java.

final void Code::setMaxStack int   max_stack [inline]
 

Parameters:
max_stack   maximum stack size

Definition at line 261 of file src/de/fub/bytecode/classfile/Code.java.

final void Code::setMaxStack int   max_stack [inline]
 

Parameters:
max_stack   maximum stack size

Definition at line 261 of file lib/jpf/de/fub/bytecode/classfile/Code.java.

final String Code::toString boolean   verbose [inline]
 

Returns:
String representation of code chunk.

Definition at line 273 of file src/de/fub/bytecode/classfile/Code.java.

final String Code::toString   [inline]
 

Returns:
String representation of code chunk.

Reimplemented from Attribute.

Definition at line 267 of file src/de/fub/bytecode/classfile/Code.java.

final String Code::toString boolean   verbose [inline]
 

Returns:
String representation of code chunk.

Definition at line 273 of file lib/jpf/de/fub/bytecode/classfile/Code.java.

final String Code::toString   [inline]
 

Returns:
String representation of code chunk.

Reimplemented from Attribute.

Definition at line 267 of file lib/jpf/de/fub/bytecode/classfile/Code.java.


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