Class BaseCodeCursor

java.lang.Object
com.android.dx.io.instructions.BaseCodeCursor
All Implemented Interfaces:
CodeCursor
Direct Known Subclasses:
ShortArrayCodeInput, ShortArrayCodeOutput

public abstract class BaseCodeCursor extends Object implements CodeCursor
Base implementation of CodeCursor.
  • Constructor Details

    • BaseCodeCursor

      public BaseCodeCursor()
      Constructs an instance.
  • Method Details

    • cursor

      public final int cursor()
      Gets the cursor. The cursor is the offset in code units from the start of the input of the next code unit to be read or written, where the input generally consists of the code for a single method.
      Specified by:
      cursor in interface CodeCursor
    • baseAddressForCursor

      public final int baseAddressForCursor()
      Gets the base address associated with the current cursor. This differs from the cursor value when explicitly set (by CodeCursor.setBaseAddress(int, int)). This is used, in particular, to convey base addresses to switch data payload instructions, whose relative addresses are relative to the address of a dependant switch instruction.
      Specified by:
      baseAddressForCursor in interface CodeCursor
    • setBaseAddress

      public final void setBaseAddress(int targetAddress, int baseAddress)
      Sets the base address for the given target address to be as indicated.
      Specified by:
      setBaseAddress in interface CodeCursor
      See Also:
    • advance

      protected final void advance(int amount)
      Advance the cursor by the indicated amount.