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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDescriptor()Returns the type or method descriptor.java.lang.StringgetName()Returns the name.java.lang.StringtoString()Returns constant type, name, and descriptor.-
Methods inherited from class classycle.classfile.Constant
extractConstantPool, getConstant
-
-
-
-
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:
toStringin classjava.lang.Object
-
-