FileDocCategorySizeDatePackage
NameAndTypeCPInfo.javaAPI DocApache Ant 1.703360Wed Dec 13 06:16:20 GMT 2006org.apache.tools.ant.taskdefs.optional.depend.constantpool

NameAndTypeCPInfo

public class NameAndTypeCPInfo extends ConstantPoolEntry
A NameAndType CP Info

Fields Summary
private String
name
the name component of this entry
private String
type
the type component of this entry
private int
nameIndex
the index into the constant pool at which the name component's string value is stored
private int
descriptorIndex
the index into the constant pool where the type descriptor string is stored.
Constructors Summary
public NameAndTypeCPInfo()
Constructor.

        super(CONSTANT_NAMEANDTYPE, 1);
    
Methods Summary
public java.lang.StringgetName()
Get the name component of this entry

return
the name of this name and type entry

        return name;
    
public java.lang.StringgetType()
Get the type signature of this entry

return
the type signature of this entry

        return type;
    
public voidread(java.io.DataInputStream cpStream)
read a constant pool entry from a class stream.

param
cpStream the DataInputStream which contains the constant pool entry to be read.
exception
IOException if there is a problem reading the entry from the stream.

        nameIndex = cpStream.readUnsignedShort();
        descriptorIndex = cpStream.readUnsignedShort();
    
public voidresolve(ConstantPool constantPool)
Resolve this constant pool entry with respect to its dependents in the constant pool.

param
constantPool the constant pool of which this entry is a member and against which this entry is to be resolved.

        name = ((Utf8CPInfo) constantPool.getEntry(nameIndex)).getValue();
        type = ((Utf8CPInfo) constantPool.getEntry(descriptorIndex)).getValue();

        super.resolve(constantPool);
    
public java.lang.StringtoString()
Print a readable version of the constant pool entry.

return
the string representation of this constant pool entry.

        String value;

        if (isResolved()) {
            value = "Name = " + name + ", type = " + type;
        } else {
            value = "Name index = " + nameIndex
                 + ", descriptor index = " + descriptorIndex;
        }

        return value;