com.android.dx.dex.file
Class IndexedItem

java.lang.Object
  extended by com.android.dx.dex.file.Item
      extended by com.android.dx.dex.file.IndexedItem
Direct Known Subclasses:
ClassDefItem, HeaderItem, IdItem, ProtoIdItem, StringIdItem

public abstract class IndexedItem
extends Item

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


Constructor Summary
IndexedItem()
          Constructs an instance.
 
Method Summary
 int getIndex()
          Gets the item index.
 boolean hasIndex()
          Gets whether or not this instance has been assigned an index.
 String indexString()
          Gets the index of this item as a string, suitable for including in annotations.
 void setIndex(int index)
          Sets the item index.
 
Methods inherited from class com.android.dx.dex.file.Item
addContents, itemType, typeName, writeSize, writeTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexedItem

public IndexedItem()
Constructs an instance. The index is initially unassigned.

Method Detail

hasIndex

public final boolean hasIndex()
Gets whether or not this instance has been assigned an index.

Returns:
true iff this instance has been assigned an index

getIndex

public final int getIndex()
Gets the item index.

Returns:
>= 0; the index
Throws:
RuntimeException - thrown if the item index is not yet assigned

setIndex

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 - >= 0; the item index

indexString

public final String indexString()
Gets the index of this item as a string, suitable for including in annotations.

Returns:
non-null; the index string


Copyright © 2013. All Rights Reserved.