FileDocCategorySizeDatePackage
ConstantPool.javaAPI DocAndroid 5.1 API2534Thu Mar 12 22:18:30 GMT 2015com.android.dexgen.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 {@code n}th entry in the constant pool, which must be valid.

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

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

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

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

param
n {@code n >= 0, n < size();} the constant pool index
return
{@code null-ok;} the corresponding entry, or {@code 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 {@code constant_pool_count}, and is in fact always at least one more than the actual size of the constant pool, as element {@code 0} is always invalid.

return
{@code >= 1;} the size