Class InterfaceRefItem


  • public class InterfaceRefItem
    extends Item<InterfaceRef>
    Represents a CONSTANT_InterfaceMethodref entry in the constant pool.
    • Constructor Detail

      • InterfaceRefItem

        public InterfaceRefItem()
    • Method Detail

      • getConstPool

        public ConstPool getConstPool()
        Returns:
        the const pool
      • setConstPool

        public void setConstPool​(ConstPool constPool)
        Binds the pool used to resolve this reference, needed when the item was not read from a class file.
        Parameters:
        constPool - the owning constant pool
      • setValue

        public void setValue​(InterfaceRef value)
        Overwrites the class and name-and-type index pair.
        Parameters:
        value - the new reference
      • read

        public void read​(ClassFile classFile)
        Description copied from class: Item
        Reads the constant pool item from the class file.
        Specified by:
        read in class Item<InterfaceRef>
        Parameters:
        classFile - The ClassFile utility to read data.
      • write

        public void write​(DataOutputStream dos)
                   throws IOException
        Description copied from class: Item
        Writes the item to the output stream (excluding the tag byte, which is written by the caller).
        Specified by:
        write in class Item<InterfaceRef>
        Parameters:
        dos - The output stream to write to.
        Throws:
        IOException - If an I/O error occurs.
      • getType

        public byte getType()
        Description copied from class: Item
        Returns the type of the constant pool item.
        Specified by:
        getType in class Item<InterfaceRef>
        Returns:
        The constant pool tag.
      • getValue

        public InterfaceRef getValue()
        Description copied from class: Item
        Returns the value held by the constant pool item.
        Specified by:
        getValue in class Item<InterfaceRef>
        Returns:
        The value of type T.
      • setClassIndex

        public void setClassIndex​(int classIndex)
        Repoints this interface-method reference at a different owner class (constant-pool class index).
        Parameters:
        classIndex - the new CONSTANT_Class index
      • getParameterCount

        public int getParameterCount()
        Returns the number of parameters for the interface method.
        Returns:
        The number of parameters.
      • getReturnTypeSlots

        public int getReturnTypeSlots()
        Returns the number of slots for the return type.
        Returns:
        The number of return type slots.
      • getOwner

        public String getOwner()
        Retrieves the owner interface internal name from the constant pool.
        Returns:
        The owner interface internal name.
      • getName

        public String getName()
        Retrieves the method name from the constant pool.
        Returns:
        The method name.
      • getDescriptor

        public String getDescriptor()
        Retrieves the method descriptor from the constant pool.
        Returns:
        The method descriptor.