Class CPInstruction

    • Field Detail

      • index

        @Deprecated
        protected int index
        Deprecated.
        (since 6.0) will be made private; do not access directly, use getter/setter
    • Constructor Detail

      • CPInstruction

        protected CPInstruction​(short opcode,
                                int index)
        Parameters:
        index - to constant pool
    • Method Detail

      • dump

        public void dump​(java.io.DataOutputStream out)
                  throws java.io.IOException
        Dump instruction as byte code to stream out.
        Overrides:
        dump in class Instruction
        Parameters:
        out - Output stream
        Throws:
        java.io.IOException
      • toString

        public java.lang.String toString​(boolean verbose)
        Long output format: <name of opcode> "["<opcode number>"]" "("<length of instruction>")" "<"< constant pool index>">"
        Overrides:
        toString in class Instruction
        Parameters:
        verbose - long/short format switch
        Returns:
        mnemonic for instruction
      • toString

        public java.lang.String toString​(ConstantPool cp)
        Overrides:
        toString in class Instruction
        Returns:
        mnemonic for instruction with symbolic references resolved
      • initFromFile

        protected void initFromFile​(ByteSequence bytes,
                                    boolean wide)
                             throws java.io.IOException
        Read needed data (i.e., index) from file.
        Overrides:
        initFromFile in class Instruction
        Parameters:
        bytes - input stream
        wide - wide prefix?
        Throws:
        java.io.IOException - may be thrown if the implementation needs to read data from the file
      • getIndex

        public final int getIndex()
        Specified by:
        getIndex in interface IndexedInstruction
        Returns:
        index in constant pool referred by this instruction.
      • setIndex

        public void setIndex​(int index)
        Set the index to constant pool.
        Specified by:
        setIndex in interface IndexedInstruction
        Parameters:
        index - in constant pool.