# Class ConstantMethodType

java.lang.Object
org.apache.bcel.classfile.Constant
org.apache.bcel.classfile.ConstantMethodType

All Implemented Interfaces:
  `Cloneable, Node`

public final class ConstantMethodType extends Constant
This class is derived from the abstract `Constant` and represents a reference to a method type.

Since:
  6.0
See Also:
  - `Constant`

- ## Field Summary

  ### Fields inherited from class Constant

  `tag`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ConstantMethodType(int descriptorIndex)`
  Constructs a ConstantMethodType.
  `ConstantMethodType(ConstantMethodType c)`
  Initialize from another object.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `accept(Visitor v)`
  Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class.
  `void`
  `dump(DataOutputStream file)`
  Dumps name and signature index to file stream in binary format.
  `int`
  `getDescriptorIndex()`
  Gets the descriptor index.
  `void`
  `setDescriptorIndex(int descriptorIndex)`
  Sets the descriptor index.
  `String`
  `toString()`

  ### Methods inherited from class Constant

  `clone, copy, equals, getComparator, getTag, hashCode, readConstant, setComparator`

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### ConstantMethodType

    public ConstantMethodType(ConstantMethodType c)
    Initialize from another object.
    Parameters:
      `c` - Source to copy.

  - ### ConstantMethodType

    public ConstantMethodType(int descriptorIndex)
    Constructs a ConstantMethodType.
    Parameters:
      `descriptorIndex` - Index to the method descriptor.

- ## Method Details

  - ### accept

    public void accept(Visitor v)
    Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.
    Specified by:
      `accept` in interface `Node`
    Specified by:
      `accept` in class `Constant`
    Parameters:
      `v` - Visitor object.

  - ### dump

    public void dump(DataOutputStream file) throws IOException
    Dumps name and signature index to file stream in binary format.
    Specified by:
      `dump` in class `Constant`
    Parameters:
      `file` - Output file stream.
    Throws:
      `IOException` - if an I/O error occurs.

  - ### getDescriptorIndex

    public int getDescriptorIndex()
    Gets the descriptor index.
    Returns:
      the descriptor index.

  - ### setDescriptorIndex

    public void setDescriptorIndex(int descriptorIndex)
    Sets the descriptor index.
    Parameters:
      `descriptorIndex` - the descriptor index.

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Constant`
    Returns:
      String representation.