Top Description Fields Constructors Methods
org.droidparts.dexmaker.dx.dex.file

public abstract Class IndexedItem

extends Item
Class Inheritance
Known Direct Subclasses
org.droidparts.dexmaker.dx.dex.file.ProtoIdItem, org.droidparts.dexmaker.dx.dex.file.StringIdItem, org.droidparts.dexmaker.dx.dex.file.ClassDefItem, org.droidparts.dexmaker.dx.dex.file.HeaderItem, org.droidparts.dexmaker.dx.dex.file.IdItem

An item in a Dalvik file which is referenced by index.

Field Summary

Modifier and TypeField and Description
private int
index

>= -1; assigned index of the item, or -1 if not yet assigned

Constructor Summary

AccessConstructor and Description
public
IndexedItem()

Constructs an instance.

Method Summary

Modifier and TypeMethod and Description
public final int

Returns:

>= 0; the index
getIndex
()

Gets the item index.

public final boolean

Returns:

true iff this instance has been assigned an index
hasIndex
()

Gets whether or not this instance has been assigned an index.

public final String

Returns:

non-null; the index string
indexString
()

Gets the index of this item as a string, suitable for including in annotations.

public final void
setIndex(int
>= 0; the item index
index
)

Sets the item index.

Inherited from org.droidparts.dexmaker.dx.dex.file.Item:
addContentsitemTypetypeNamewriteSizewriteTo

Field Detail

indexback to summary
private int index

>= -1; assigned index of the item, or -1 if not yet assigned

Constructor Detail

IndexedItemback to summary
public IndexedItem()

Constructs an instance. The index is initially unassigned.

Method Detail

getIndexback to summary
public final int getIndex()

Gets the item index.

Returns:int

>= 0; the index

Exceptions
RuntimeException:
thrown if the item index is not yet assigned
hasIndexback to summary
public final boolean hasIndex()

Gets whether or not this instance has been assigned an index.

Returns:boolean

true iff this instance has been assigned an index

indexStringback to summary
public final String indexString()

Gets the index of this item as a string, suitable for including in annotations.

Returns:String

non-null; the index string

setIndexback to summary
public final void setIndex(int index)

Sets the item index. This method may only ever be called once per instance, and this will throw a RuntimeException if called a second (or subsequent) time.

Parameters
index:int

>= 0; the item index