FileDocCategorySizeDatePackage
CONSTANT_NameAndType_info.javaAPI DocAndroid 1.5 API3438Wed May 06 22:41:16 BST 2009com.vladium.jcd.cls.constant

CONSTANT_NameAndType_info

public final class CONSTANT_NameAndType_info extends CONSTANT_info
The CONSTANT_NameAndType_info structure is used to represent a field or method, without indicating which class or interface type it belongs to.

The value of the name_index item must be a valid index into the constant pool table. The constant pool entry at that index must be a {@link CONSTANT_Utf8_info} structure representing a valid Java field name or method name stored as a simple (not fully qualified) name, that is, as a Java identifier.

The value of the descriptor_index item must be a valid index into the constant pool table. The constant pool entry at that index must be a {@link CONSTANT_Utf8_info} structure representing a valid Java field descriptor or method descriptor.

author
(C) 2001, Vlad Roubtsov

Fields Summary
public static final byte
TAG
public int
m_name_index
public int
m_descriptor_index
Constructors Summary
public CONSTANT_NameAndType_info(int name_index, int descriptor_index)

    
    
           
    
        m_name_index = name_index;
        m_descriptor_index = descriptor_index;
    
protected CONSTANT_NameAndType_info(com.vladium.jcd.lib.UDataInputStream bytes)

        m_name_index = bytes.readU2 ();
        m_descriptor_index = bytes.readU2 ();
    
Methods Summary
public java.lang.Objectaccept(ICONSTANTVisitor visitor, java.lang.Object ctx)

        return visitor.visit (this, ctx);
    
public java.lang.StringgetDescriptor(com.vladium.jcd.cls.ClassDef cls)

        return ((CONSTANT_Utf8_info) cls.getConstants ().get (m_descriptor_index)).m_value;
    
public java.lang.StringgetName(com.vladium.jcd.cls.ClassDef cls)

        return ((CONSTANT_Utf8_info) cls.getConstants ().get (m_name_index)).m_value;
    
public final bytetag()

        return TAG;
    
public java.lang.StringtoString()

        return "CONSTANT_NameAndType: [name_index = " + m_name_index + ", descriptor_index = " + m_descriptor_index + ']";
    
public voidwriteInClassFormat(com.vladium.jcd.lib.UDataOutputStream out)

        super.writeInClassFormat (out);
        
        out.writeU2 (m_name_index);
        out.writeU2 (m_descriptor_index);