# Class NameSignatureInstruction

java.lang.Object
org.apache.bcel.generic.Instruction
org.apache.bcel.generic.CPInstruction
org.apache.bcel.generic.NameSignatureInstruction

All Implemented Interfaces:
  `Cloneable, IndexedInstruction, TypedInstruction`

public abstract class NameSignatureInstruction extends CPInstruction
Super class for FieldOrMethod and INVOKEDYNAMIC, since they both have names and signatures

Since:
  6.0

- ## Field Summary

  ### Fields inherited from class CPInstruction

  `index`

  ### Fields inherited from class Instruction

  `length, opcode`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `NameSignatureInstruction()`
  `NameSignatureInstruction(short opcode, int index)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getName(ConstantPoolGen cpg)`
  `ConstantNameAndType`
  `getNameAndType(ConstantPoolGen cpg)`
  `String`
  `getSignature(ConstantPoolGen cpg)`

  ### Methods inherited from class CPInstruction

  `dump, getIndex, getType, initFromFile, setIndex, toString, toString`

  ### Methods inherited from class Instruction

  `accept, consumeStack, copy, equals, getComparator, getLength, getName, getOpcode, hashCode, isValidByte, isValidShort, produceStack, readInstruction, setComparator, toString`

  ### Methods inherited from class Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### NameSignatureInstruction

    public NameSignatureInstruction()

  - ### NameSignatureInstruction

    public NameSignatureInstruction(short opcode, int index)

- ## Method Details

  - ### getName

    public String getName(ConstantPoolGen cpg)
    Returns:
      name of referenced method/field.

  - ### getNameAndType

    public ConstantNameAndType getNameAndType(ConstantPoolGen cpg)

  - ### getSignature

    public String getSignature(ConstantPoolGen cpg)
    Returns:
      signature of referenced method/field.