FileDocCategorySizeDatePackage
ConstNameAndType.javaAPI DocGlassfish v2 API4120Fri May 04 22:34:28 BST 2007com.sun.jdo.api.persistence.enhancer.classfile

ConstNameAndType

public class ConstNameAndType extends ConstBasic
Class representing a name and an associated type in the constant pool of a class file

Fields Summary
public static final int
MyTag
private ConstUtf8
theName
private int
theNameIndex
private ConstUtf8
typeSignature
private int
typeSignatureIndex
Constructors Summary
ConstNameAndType(ConstUtf8 n, ConstUtf8 sig)

    theName = n; typeSignature = sig;
  
ConstNameAndType(int n, int sig)

    theNameIndex = n; typeSignatureIndex = sig;
  
Methods Summary
public voidchangeSignature(ConstUtf8 newSig)
Modify the signature

    typeSignature = newSig;
  
voidformatData(java.io.DataOutputStream b)

    b.writeShort(theName.getIndex());
    b.writeShort(typeSignature.getIndex());
  
public ConstUtf8name()
Return the name

    return theName;
  
static com.sun.jdo.api.persistence.enhancer.classfile.ConstNameAndTyperead(java.io.DataInputStream input)

    int cname = input.readUnsignedShort();
    int sig = input.readUnsignedShort();

    return new ConstNameAndType (cname, sig);
  
voidresolve(ConstantPool p)

    theName = (ConstUtf8) p.constantAt(theNameIndex);
    typeSignature = (ConstUtf8) p.constantAt(typeSignatureIndex);
  
public ConstUtf8signature()
Return the type signature associated with the name

    return typeSignature;
  
public inttag()
The tag of this constant entry


  /* public accessors */

           
       return MyTag; 
public java.lang.StringtoString()
A printable representation

      return "CONSTANTNameAndType(" + indexAsString() + "): " + //NOI18N
          "name(" + theName.toString() + ") " +//NOI18N
          " type(" + typeSignature.toString() + ")";//NOI18N