com.android.dx.dex.file
Class FieldIdItem

java.lang.Object
  extended by com.android.dx.dex.file.Item
      extended by com.android.dx.dex.file.IndexedItem
          extended by com.android.dx.dex.file.IdItem
              extended by com.android.dx.dex.file.MemberIdItem
                  extended by com.android.dx.dex.file.FieldIdItem

public final class FieldIdItem
extends MemberIdItem

Representation of a field reference inside a Dalvik file.


Constructor Summary
FieldIdItem(CstFieldRef field)
          Constructs an instance.
 
Method Summary
 void addContents(DexFile file)
          Populates a DexFile with items from within this instance.
 CstFieldRef getFieldRef()
          Gets the field constant.
protected  int getTypoidIdx(DexFile file)
          Returns the index of the type-like thing associated with this item, in order that it may be written out.
protected  String getTypoidName()
          Returns the field name of the type-like thing associated with this item, for listing-generating purposes.
 ItemType itemType()
          Returns the item type for this instance.
 
Methods inherited from class com.android.dx.dex.file.MemberIdItem
getRef, writeSize, writeTo
 
Methods inherited from class com.android.dx.dex.file.IdItem
getDefiningClass
 
Methods inherited from class com.android.dx.dex.file.IndexedItem
getIndex, hasIndex, indexString, setIndex
 
Methods inherited from class com.android.dx.dex.file.Item
typeName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldIdItem

public FieldIdItem(CstFieldRef field)
Constructs an instance.

Parameters:
field - non-null; the constant for the field
Method Detail

itemType

public ItemType itemType()
Returns the item type for this instance.

Specified by:
itemType in class Item
Returns:
non-null; the item type

addContents

public void addContents(DexFile file)
Populates a DexFile with items from within this instance. This will not add an item to the file for this instance itself (which should have been done by whatever refers to this instance).

Note: Subclasses must override this to do something appropriate.

Overrides:
addContents in class MemberIdItem
Parameters:
file - non-null; the file to populate

getFieldRef

public CstFieldRef getFieldRef()
Gets the field constant.

Returns:
non-null; the constant

getTypoidIdx

protected int getTypoidIdx(DexFile file)
Returns the index of the type-like thing associated with this item, in order that it may be written out. Subclasses must override this to get whatever it is they need to store.

Specified by:
getTypoidIdx in class MemberIdItem
Parameters:
file - non-null; the file being written
Returns:
the index in question

getTypoidName

protected String getTypoidName()
Returns the field name of the type-like thing associated with this item, for listing-generating purposes. Subclasses must override this.

Specified by:
getTypoidName in class MemberIdItem
Returns:
non-null; the name in question


Copyright © 2015. All rights reserved.