Class FieldRef


  • public class FieldRef
    extends Object
    The index pair of a CONSTANT_Fieldref entry - owning class and name-and-type.
    • Constructor Detail

      • FieldRef

        public FieldRef​(int classIndex,
                        int nameAndTypeIndex)
        Creates a field reference from its two constant pool indices.
        Parameters:
        classIndex - the index of the CONSTANT_Class entry
        nameAndTypeIndex - the index of the CONSTANT_NameAndType entry
    • Method Detail

      • getClassIndex

        public int getClassIndex()
        Returns:
        the class index
      • getNameAndTypeIndex

        public int getNameAndTypeIndex()
        Returns:
        the name and type index
      • setClassIndex

        public void setClassIndex​(int classIndex)
        Repoints the reference at another owning class entry.
        Parameters:
        classIndex - the constant pool index of the CONSTANT_Class entry
      • setNameAndTypeIndex

        public void setNameAndTypeIndex​(int nameAndTypeIndex)
        Repoints the reference at another name-and-type entry.
        Parameters:
        nameAndTypeIndex - the constant pool index of the CONSTANT_NameAndType entry