FileDocCategorySizeDatePackage
ConstantPool.javaAPI DocAndroid 1.5 API2627Wed May 06 22:41:02 BST 2009com.android.dx.rop.cst

ConstantPool

public interface ConstantPool
Interface for constant pools, which are, more or less, just lists of {@link Constant} objects.

Fields Summary
Constructors Summary
Methods Summary
public Constantget(int n)
Get the nth entry in the constant pool, which must be valid.

param
n n >= 0, n < size(); the constant pool index
return
non-null; the corresponding entry
throws
IllegalArgumentException thrown if n is in-range but invalid

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

param
n n >= 0, n < size(); the constant pool index
return
null-ok; the corresponding entry, if n != 0
throws
IllegalArgumentException thrown if n is in-range and non-zero but invalid

public ConstantgetOrNull(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).

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

public intsize()
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.

return
>= 1; the size