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

public final Class StringIdsSection

extends UniformItemSection
Class Inheritance
Imports
org.droidparts.dexmaker.dx.rop.cst.Constant, .CstNat, .CstString, org.droidparts.dexmaker.dx.util.AnnotatedOutput, .Hex, java.util.Collection, .TreeMap

Strings list section of a .dex file.

Field Summary

Modifier and TypeField and Description
private final TreeMap<CstString, StringIdItem>
strings

non-null; map from string constants to StringIdItem instances

Constructor Summary

AccessConstructor and Description
public
StringIdsSection(DexFile
non-null; file that this instance is part of
file
)

Constructs an instance.

Method Summary

Modifier and TypeMethod and Description
public IndexedItem
get(Constant
non-null; constant to look for
cst
)

Implements abstract org.droidparts.dexmaker.dx.dex.file.UniformItemSection.get.

Gets the item corresponding to the given Constant.
public int

Returns:

>= 0; the string's index
indexOf
(CstString
non-null; the string to look up
string
)

Gets the index of the given string, which must have been added to this instance.

public StringIdItem

Returns:

non-null; the interned string
intern
(String
non-null; the string to intern, as a regular Java String
string
)

Interns an element into this instance.

public StringIdItem

Returns:

non-null; the interned string
intern
(CstString
non-null; the string to intern, as a constant
string
)

Interns an element into this instance.

public StringIdItem

Returns:

non-null; the interned string
intern
(StringIdItem
non-null; the string to intern
string
)

Interns an element into this instance.

public void
intern(CstNat
non-null; the name-and-type
nat
)

Interns the components of a name-and-type into this instance.

public Collection<? extends Item>
items()

Implements abstract org.droidparts.dexmaker.dx.dex.file.Section.items.

Gets the collection of all the items in this section.
protected void
orderItems()

Implements abstract org.droidparts.dexmaker.dx.dex.file.UniformItemSection.orderItems.

Alters or picks the order for items in this instance if desired, so that subsequent calls to items will yield a so-ordered collection.
public void
writeHeaderPart(AnnotatedOutput
non-null; where to write
out
)

Writes the portion of the file header that refers to this instance.

Inherited from org.droidparts.dexmaker.dx.dex.file.UniformItemSection:
getAbsoluteItemOffsetprepare0writeSizewriteTo0

Field Detail

stringsback to summary
private final TreeMap<CstString, StringIdItem> strings

non-null; map from string constants to StringIdItem instances

Constructor Detail

StringIdsSectionback to summary
public StringIdsSection(DexFile file)

Constructs an instance. The file offset is initially unknown.

Parameters
file:DexFile

non-null; file that this instance is part of

Method Detail

getback to summary
public IndexedItem get(Constant cst)

Implements abstract org.droidparts.dexmaker.dx.dex.file.UniformItemSection.get.

Doc from org.droidparts.dexmaker.dx.dex.file.UniformItemSection.get.

Gets the item corresponding to the given Constant. This will throw an exception if the constant is not found, including if this instance isn't the sort that maps constants to IndexedItem instances.

Parameters
cst:Constant

non-null; constant to look for

Returns:IndexedItem

non-null; the corresponding item found in this instance

Annotations
@Override
indexOfback to summary
public int indexOf(CstString string)

Gets the index of the given string, which must have been added to this instance.

Parameters
string:CstString

non-null; the string to look up

Returns:int

>= 0; the string's index

internback to summary
public StringIdItem intern(String string)

Interns an element into this instance.

Parameters
string:String

non-null; the string to intern, as a regular Java String

Returns:StringIdItem

non-null; the interned string

internback to summary
public StringIdItem intern(CstString string)

Interns an element into this instance.

Parameters
string:CstString

non-null; the string to intern, as a constant

Returns:StringIdItem

non-null; the interned string

internback to summary
public StringIdItem intern(StringIdItem string)

Interns an element into this instance.

Parameters
string:StringIdItem

non-null; the string to intern

Returns:StringIdItem

non-null; the interned string

internback to summary
public void intern(CstNat nat)

Interns the components of a name-and-type into this instance.

Parameters
nat:CstNat

non-null; the name-and-type

itemsback to summary
public Collection<? extends Item> items()

Implements abstract org.droidparts.dexmaker.dx.dex.file.Section.items.

Doc from org.droidparts.dexmaker.dx.dex.file.Section.items.

Gets the collection of all the items in this section. It is not valid to attempt to change the returned list.

Returns:Collection<? extends Item>

non-null; the items

Annotations
@Override
orderItemsback to summary
protected void orderItems()

Implements abstract org.droidparts.dexmaker.dx.dex.file.UniformItemSection.orderItems.

Doc from org.droidparts.dexmaker.dx.dex.file.UniformItemSection.orderItems.

Alters or picks the order for items in this instance if desired, so that subsequent calls to items will yield a so-ordered collection. If the items in this instance are indexed, then this method should also assign indices.

Annotations
@Override
writeHeaderPartback to summary
public void writeHeaderPart(AnnotatedOutput out)

Writes the portion of the file header that refers to this instance.

Parameters
out:AnnotatedOutput

non-null; where to write