FileDocCategorySizeDatePackage
JConstantMethodRef.javaAPI DocphoneME MR2 API (J2ME)3118Wed May 02 18:00:40 BST 2007com.sun.satsa.jcrmic.classfile.constants

JConstantMethodRef

public class JConstantMethodRef extends JConstant
This class represents a symbolic reference to a class method.

Fields Summary
private int
class_index
Class constant pool entry index.
private int
nameAndType_index
Method name and type constant pool entry index.
protected String
class_name
Class name.
protected String
method_name
Method name.
protected String
descriptor
Method descriptor.
Constructors Summary
public JConstantMethodRef(JConstantPool cp)
Constructor.

param
cp constant pool reference

        super(cp);
    
Methods Summary
public java.lang.StringgetClassName()
Returns class name.

return
class name

        resolve();
        return class_name;
    
public java.lang.StringgetDescriptor()
Returns method descriptor.

return
method descriptor

        resolve();
        return descriptor;
    
public java.lang.StringgetMethodName()
Returns method name.

return
method name

        resolve();
        return method_name;
    
public voidparse(java.io.DataInputStream dis)
Parses constant pool entry.

param
dis input stream
throws
IOException if I/O exception occurs

        class_index = dis.readUnsignedShort();
        nameAndType_index = dis.readUnsignedShort();
    
private voidresolve()
Resolves the constant pool entry.


        if (! resolved) {

	        class_name = cp.getConstantClass(class_index).getClassName();

            JConstantNameAndType nameAndTypeConstant =
                    cp.getConstantNameAndType(nameAndType_index);

            method_name = nameAndTypeConstant.getName();
            descriptor = nameAndTypeConstant.getDescriptor();

            resolved = true;
        }