Package classycle.classfile

# Class NameAndTypeConstant

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

public class NameAndTypeConstant extends Constant
Constant holding a name and a type or method descriptor.

Author:
  Franz-Josef Elmer

## Constructor Summary

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

## Method Summary

Modifier and Type
Method
Description
`String`
`getDescriptor()`
Returns the type or method descriptor.
`String`
`getName()`
Returns the name.
`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 Details

### 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 Details

### getName

public String getName()
Returns the name.

### getDescriptor

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

### toString

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

Overrides:
  `toString` in class `Object`