net.sf.rej.java.constantpool
Class NameAndTypeInfo
java.lang.Object
net.sf.rej.java.constantpool.ConstantPoolInfo
net.sf.rej.java.constantpool.NameAndTypeInfo
- All Implemented Interfaces:
- DescriptorEnabled
public class NameAndTypeInfo
- extends ConstantPoolInfo
- implements DescriptorEnabled
Models a NameAndTypeInfo entry in the constant pool of a class. It is a
reference to the name and type of a method or field. It points to a name
entry, and a descriptor entry which has a return type and a possible type for
parameters.
- Author:
- Sami Koivu
Fields inherited from class net.sf.rej.java.constantpool.ConstantPoolInfo |
CLASS, DOUBLE, FIELD_REF, FLOAT, INTEGER, INTERFACE_METHOD_REF, LONG, METHOD_REF, NAME_AND_TYPE, STRING, UTF8 |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
NameAndTypeInfo
public NameAndTypeInfo(int nameIndex,
int descriptorIndex,
ConstantPool pool)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
getName
public java.lang.String getName()
getNameInfo
public UTF8Info getNameInfo()
getDescriptorString
public java.lang.String getDescriptorString()
getData
public byte[] getData()
- Description copied from class:
ConstantPoolInfo
- Return the data of this entry in the form that it can be written to a class file.
- Specified by:
getData
in class ConstantPoolInfo
- Returns:
- byte[] array with data
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in class java.lang.Object
getDescriptor
public Descriptor getDescriptor()
setDescriptorIndex
public void setDescriptorIndex(int index)
- Specified by:
setDescriptorIndex
in interface DescriptorEnabled
getTypeString
public java.lang.String getTypeString()
- Description copied from class:
ConstantPoolInfo
- Return a String describing the type of this instance.
- Specified by:
getTypeString
in class ConstantPoolInfo
- Returns:
- The type of this entry as a String.
setNameIndex
public void setNameIndex(int nameIndex)
getNameIndex
public int getNameIndex()
getDescriptorIndex
public int getDescriptorIndex()
- Specified by:
getDescriptorIndex
in interface DescriptorEnabled