Top Description Methods
org.droidparts.dexmaker.dx.rop.cst

public Interface ConstantPool

Known Direct Implementers
org.droidparts.dexmaker.dx.rop.cst.StdConstantPool

Interface for constant pools, which are, more or less, just lists of Constant objects.

Method Summary

Modifier and TypeMethod and Description
public Constant

Returns:

non-null; the corresponding entry
get
(int
n >= 0, n < size(); the constant pool index
n
)

Get the nth entry in the constant pool, which must be valid.

public Constant

Returns:

null-ok; the corresponding entry, if n != 0
get0Ok
(int
n >= 0, n < size(); the constant pool index
n
)

Get the nth entry in the constant pool, which must be valid unless n == 0, in which case null is returned.

public Constant

Returns:

null-ok; the corresponding entry, or null if the index is in-range but invalid
getOrNull
(int
n >= 0, n < size(); the constant pool index
n
)

Get the nth entry in the constant pool, or null if the index is in-range but invalid.

public int

Returns:

>= 1; the size
size
()

Get the "size" of the constant pool.

Method Detail

getback to summary
public Constant get(int n)

Get the nth entry in the constant pool, which must be valid.

Parameters
n:int

n >= 0, n < size(); the constant pool index

Returns:Constant

non-null; the corresponding entry

Exceptions
IllegalArgumentException:
thrown if n is in-range but invalid
get0Okback to summary
public Constant get0Ok(int n)

Get the nth entry in the constant pool, which must be valid unless n == 0, in which case null is returned.

Parameters
n:int

n >= 0, n < size(); the constant pool index

Returns:Constant

null-ok; the corresponding entry, if n != 0

Exceptions
IllegalArgumentException:
thrown if n is in-range and non-zero but invalid
getOrNullback to summary
public Constant getOrNull(int n)

Get the nth entry in the constant pool, or null if the index is in-range but invalid. In particular, null is returned for index 0 as well as the index after any entry which is defined to take up two slots (that is, Long and Double entries).

Parameters
n:int

n >= 0, n < size(); the constant pool index

Returns:Constant

null-ok; the corresponding entry, or null if the index is in-range but invalid

sizeback to summary
public int size()

Get the "size" of the constant pool. This corresponds to the class file field constant_pool_count, and is in fact always at least one more than the actual size of the constant pool, as element 0 is always invalid.

Returns:int

>= 1; the size