classycle.classfile
Class NameAndTypeConstant

java.lang.Object
  extended by classycle.classfile.Constant
      extended by classycle.classfile.NameAndTypeConstant

public class NameAndTypeConstant
extends Constant

Constant holding a name and a type or method descriptor.

Author:
Franz-Josef Elmer

Constructor Summary
NameAndTypeConstant(Constant[] pool, int nameIndex, int descriptorIndex)
          Creates an instance for the specified name and type or method descriptor.
 
Method Summary
 java.lang.String getDescriptor()
          Returns the type or method descriptor.
 java.lang.String getName()
          Returns the name.
 java.lang.String toString()
          Returns constant type, name, and descriptor.
 
Methods inherited from class classycle.classfile.Constant
extractConstantPool, getConstant
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NameAndTypeConstant

public NameAndTypeConstant(Constant[] pool,
                           int nameIndex,
                           int descriptorIndex)
Creates an instance for the specified name and type or method descriptor.

Parameters:
pool - Constant pool. Needed to resolve references.
nameIndex - Index of the name in the pool.
descriptorIndex - Index of the type or method descriptor in the pool.
Method Detail

getName

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


getDescriptor

public java.lang.String getDescriptor()
Returns the type or method descriptor.


toString

public java.lang.String toString()
Returns constant type, name, and descriptor.

Overrides:
toString in class java.lang.Object