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

JConstantNameAndType

public class JConstantNameAndType extends JConstant
This class represents a symbolic reference to a field or method without indicating which class or interface type it belongs to.

Fields Summary
private int
name_index
Name index.
private int
descriptor_index
Descriptor index.
private String
name
Name.
private String
descriptor
Descriptor.
Constructors Summary
public JConstantNameAndType(JConstantPool cp)
Constructor.

param
cp constant pool reference

        super(cp);
    
Methods Summary
public java.lang.StringgetDescriptor()
Returns the descriptor.

return
the descriptor.

        resolve();
        return descriptor;
    
public java.lang.StringgetName()
Returns the name.

return
the name.

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

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

        name_index = dis.readUnsignedShort();
        descriptor_index = dis.readUnsignedShort();
    
private voidresolve()
Resolves the constant pool entry.


        if (! resolved) {
            name = cp.getConstantUtf8(name_index).getString();
            descriptor = cp.getConstantUtf8(descriptor_index).getString();
            resolved = true;
        }