proguard.classfile.constant
Class NameAndTypeConstant

java.lang.Object
  extended by proguard.classfile.constant.Constant
      extended by proguard.classfile.constant.NameAndTypeConstant
All Implemented Interfaces:
VisitorAccepter

public class NameAndTypeConstant
extends Constant

This Constant represents a name and type constant in the constant pool.


Field Summary
 int u2descriptorIndex
           
 int u2nameIndex
           
 
Fields inherited from class proguard.classfile.constant.Constant
visitorInfo
 
Constructor Summary
NameAndTypeConstant()
          Creates an uninitialized NameAndTypeConstant.
NameAndTypeConstant(int u2nameIndex, int u2descriptorIndex)
          Creates a new NameAndTypeConstant with the given name and type indices.
 
Method Summary
 void accept(Clazz clazz, ConstantVisitor constantVisitor)
          Accepts the given visitor.
protected  int getDescriptorIndex()
          Returns the descriptor index.
 java.lang.String getName(Clazz clazz)
          Returns the name.
protected  int getNameIndex()
          Returns the name index.
 int getTag()
          Returns the constant pool info tag that specifies the entry type.
 java.lang.String getType(Clazz clazz)
          Returns the type.
protected  void setDescriptorIndex(int index)
          Sets the descriptor index.
protected  void setNameIndex(int index)
          Sets the name index.
 
Methods inherited from class proguard.classfile.constant.Constant
getVisitorInfo, setVisitorInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

u2nameIndex

public int u2nameIndex

u2descriptorIndex

public int u2descriptorIndex
Constructor Detail

NameAndTypeConstant

public NameAndTypeConstant()
Creates an uninitialized NameAndTypeConstant.


NameAndTypeConstant

public NameAndTypeConstant(int u2nameIndex,
                           int u2descriptorIndex)
Creates a new NameAndTypeConstant with the given name and type indices.

Parameters:
u2nameIndex - the index of the name in the constant pool.
u2descriptorIndex - the index of the descriptor in the constant pool.
Method Detail

getNameIndex

protected int getNameIndex()
Returns the name index.


setNameIndex

protected void setNameIndex(int index)
Sets the name index.


getDescriptorIndex

protected int getDescriptorIndex()
Returns the descriptor index.


setDescriptorIndex

protected void setDescriptorIndex(int index)
Sets the descriptor index.


getName

public java.lang.String getName(Clazz clazz)
Returns the name.


getType

public java.lang.String getType(Clazz clazz)
Returns the type.


getTag

public int getTag()
Description copied from class: Constant
Returns the constant pool info tag that specifies the entry type.

Specified by:
getTag in class Constant

accept

public void accept(Clazz clazz,
                   ConstantVisitor constantVisitor)
Description copied from class: Constant
Accepts the given visitor.

Specified by:
accept in class Constant