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