Package com.android.dx.io.instructions
Class BaseCodeCursor
java.lang.Object
com.android.dx.io.instructions.BaseCodeCursor
- All Implemented Interfaces:
CodeCursor
- Direct Known Subclasses:
ShortArrayCodeInput
,ShortArrayCodeOutput
Base implementation of
CodeCursor
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected final void
advance
(int amount) Advance the cursor by the indicated amount.final int
Gets the base address associated with the current cursor.final int
cursor()
Gets the cursor.final void
setBaseAddress
(int targetAddress, int baseAddress) Sets the base address for the given target address to be as indicated.
-
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 interfaceCodeCursor
-
baseAddressForCursor
public final int baseAddressForCursor()Gets the base address associated with the current cursor. This differs from the cursor value when explicitly set (byCodeCursor.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 interfaceCodeCursor
-
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 interfaceCodeCursor
- See Also:
-
advance
protected final void advance(int amount) Advance the cursor by the indicated amount.
-