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

cp_info Class Reference

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

Public Methods

abstract int compareTo (cp_info constant_pool[], cp_info cp, cp_info cp_constant_pool[])
abstract int size ()
abstract String toString (cp_info constant_pool[])
abstract String typeName ()

Static Public Methods

int countParams (cp_info constant_pool[], int m)
String fieldType (cp_info constant_pool[], int i)
String getClassname (cp_info constant_pool[], int i)
String getName (cp_info constant_pool[], int i)
String getTypeDescr (cp_info constant_pool[], int i)
long ints2long (long high, long low)
String printBits (int i)
String printBits (long i)

Public Attributes

byte tag

Static Public Attributes

final byte CONSTANT_Utf8 = 1
final byte CONSTANT_Integer = 3
final byte CONSTANT_Float = 4
final byte CONSTANT_Long = 5
final byte CONSTANT_Double = 6
final byte CONSTANT_Class = 7
final byte CONSTANT_String = 8
final byte CONSTANT_Fieldref = 9
final byte CONSTANT_Methodref = 10
final byte CONSTANT_InterfaceMethodref = 11
final byte CONSTANT_NameAndType = 12

Detailed Description

Base abstract class for constant pool entries; includes some utility methods.
See also:
ClassFile::constant_pool
Author:
Clark Verbrugge

Definition at line 120 of file cp_info.java.


Member Function Documentation

abstract int cp_info::compareTo cp_info   constant_pool[],
cp_info   cp,
cp_info   cp_constant_pool[]
[pure virtual]
 

Compares this entry with another cp_info object (which may reside in a different constant pool).

Parameters:
constant_pool   constant pool of ClassFile for this.
cp   constant pool entry to compare against.
cp_constant_pool   constant pool of ClassFile for cp.
Returns:
a value <0, 0, or >0 indicating whether this is smaller, the same or larger than cp.

Reimplemented in CONSTANT_Class_info, CONSTANT_Double_info, CONSTANT_Fieldref_info, CONSTANT_Float_info, CONSTANT_Integer_info, CONSTANT_InterfaceMethodref_info, CONSTANT_Long_info, CONSTANT_Methodref_info, CONSTANT_NameAndType_info, CONSTANT_String_info, and CONSTANT_Utf8_info.

Referenced by CONSTANT_Utf8_info::compareTo(), CONSTANT_String_info::compareTo(), CONSTANT_NameAndType_info::compareTo(), CONSTANT_Methodref_info::compareTo(), CONSTANT_InterfaceMethodref_info::compareTo(), CONSTANT_Fieldref_info::compareTo(), and CONSTANT_Class_info::compareTo().

int cp_info::countParams cp_info   constant_pool[],
int   m
[inline, static]
 

Counts the number of parameters of the given method.

Parameters:
constant_pool   constant pool of ClassFile.
m   a constant pool index as accepted by getTypeDescr.
Returns:
the number of parameters.
See also:
ClassFile::parseMethodDesc_params , cp_info::getTypeDescr

Definition at line 154 of file cp_info.java.

String cp_info::fieldType cp_info   constant_pool[],
int   i
[inline, static]
 

Returns the name of the field type of the given constant pool object.

Parameters:
constant_pool   constant pool of ClassFile.
i   a constant pool index for an entry of type CONSTANT_Utf8, CONSTANT_NameAndType, or CONSTANT_FieldRef.
Returns:
the type of the field.
See also:
CONSTANT_Utf8_info , CONSTANT_NameAndType_info::name_index , CONSTANT_Fieldref_info::name_and_type_index , cp_info::getTypeDescr , ClassFile::parseDesc

Definition at line 172 of file cp_info.java.

String cp_info::getClassname cp_info   constant_pool[],
int   i
[inline, static]
 

Locates the name of the corresponding class, given the constant pool index of either a CONSTANT_Class, _Fieldref, Methodref or InterfaceMethodref.

Parameters:
constant_pool   constant pool of ClassFile.
i   index of cp_info entry in question.
Returns:
name of the associated class.
See also:
CONSTANT_Class_info::toString(constant_pool) , CONSTANT_Fieldref_info::class_index , CONSTANT_Methodref_info::class_index , CONSTANT_InterfaceMethodref_info::class_index

Definition at line 186 of file cp_info.java.

String cp_info::getName cp_info   constant_pool[],
int   i
[inline, static]
 

Returns the name of the given constant pool object, assuming it is of type CONSTANT_NameAndType, _FieldRef, _Methodref or _InterfaceMethodref.

Parameters:
constant_pool   constant pool of ClassFile.
i   index of cp_info entry in question.
Returns:
name of the associated object.
See also:
CONSTANT_Utf8_info , CONSTANT_NameAndType_info::name_index , CONSTANT_Fieldref_info::name_and_type_index , CONSTANT_Methodref_info::name_and_type_index , CONSTANT_InterfaceMethodref_info::name_and_type_index

Definition at line 213 of file cp_info.java.

String cp_info::getTypeDescr cp_info   constant_pool[],
int   i
[inline, static]
 

Returns the type descriptor for the given constant pool object, which must be a CONSTANT_Utf8, CONSTANT_NameAndType, CONSTANT_Fieldref, CONSTANT_MethodRef, or CONSTANT_InterfaceMethodRef.

Parameters:
constant_pool   constant pool of ClassFile.
i   a constant pool index for an entry of type CONSTANT_Utf8, CONSTANT_NameAndType, CONSTANT_MethodRef, or CONSTANT_InterfaceMethodRef.
Returns:
the type descriptor.
See also:
CONSTANT_Utf8_info , CONSTANT_NameAndType_info::name_index , CONSTANT_Fieldref_info::name_and_type_index , CONSTANT_Methodref_info::name_and_type_index , CONSTANT_InterfaceMethodref_info::name_and_type_index

Definition at line 244 of file cp_info.java.

Referenced by countParams(), and fieldType().

long cp_info::ints2long long   high,
long   low
[inline, static]
 

Utility method, converts two integers into a single long.

Parameters:
high   upper 32 bits of the long.
low   lower 32 bits of the long.
Returns:
a long value composed from the two ints.

Definition at line 268 of file cp_info.java.

Referenced by CONSTANT_Long_info::convert(), and CONSTANT_Double_info::convert().

String cp_info::printBits long   i [inline, static]
 

Utility method, returns a String binary representation of the given long.

Parameters:
i   the long in question.
Returns:
a String of 0's and 1's.
See also:
cp_info::printBits(int)

Definition at line 298 of file cp_info.java.

String cp_info::printBits int   i [inline, static]
 

Utility method, returns a String binary representation of the given integer.

Parameters:
i   the integer in question.
Returns:
a String of 0's and 1's.
See also:
cp_info::printBits(long)

Definition at line 279 of file cp_info.java.

abstract int cp_info::size   [pure virtual]
 

Returns the size of this entry.

Returns:
size (in bytes) of this entry.

Reimplemented in CONSTANT_Class_info, CONSTANT_Double_info, CONSTANT_Fieldref_info, CONSTANT_Float_info, CONSTANT_Integer_info, CONSTANT_InterfaceMethodref_info, CONSTANT_Long_info, CONSTANT_Methodref_info, CONSTANT_NameAndType_info, CONSTANT_String_info, and CONSTANT_Utf8_info.

abstract String cp_info::toString cp_info   constant_pool[] [pure virtual]
 

Returns a String representation of this entry.

Parameters:
constant_pool   constant pool of ClassFile.
Returns:
String representation of this entry.

Reimplemented in CONSTANT_Class_info, CONSTANT_Double_info, CONSTANT_Fieldref_info, CONSTANT_Float_info, CONSTANT_Integer_info, CONSTANT_InterfaceMethodref_info, CONSTANT_Long_info, CONSTANT_Methodref_info, CONSTANT_NameAndType_info, CONSTANT_String_info, and CONSTANT_Utf8_info.

Referenced by getClassname(), getName(), getTypeDescr(), ClassFile::listConstantPool(), ClassFile::readConstantPool(), Instruction_intindex::toString(), Instruction_byteindex::toString(), and ClassFile::toString().

abstract String cp_info::typeName   [pure virtual]
 

Returns a String description of what kind of entry this is.

Returns:
String representation of this kind of entry.

Reimplemented in CONSTANT_Class_info, CONSTANT_Double_info, CONSTANT_Fieldref_info, CONSTANT_Float_info, CONSTANT_Integer_info, CONSTANT_InterfaceMethodref_info, CONSTANT_Long_info, CONSTANT_Methodref_info, CONSTANT_NameAndType_info, CONSTANT_String_info, and CONSTANT_Utf8_info.

Referenced by ClassFile::listConstantPool().


Member Data Documentation

byte cp_info::tag
 

One of the CONSTANT_* constants.

Definition at line 135 of file cp_info.java.


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