|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.android.dx.util.MutabilityControl
com.android.dx.rop.cst.StdConstantPool
public final class StdConstantPool
Standard implementation of ConstantPool, which directly stores
an array of Constant objects and can be made immutable.
| Constructor Summary | |
|---|---|
StdConstantPool(int size)
Constructs an instance. |
|
| Method Summary | |
|---|---|
Constant |
get(int n)
Get the nth entry in the constant pool, which must
be valid. |
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. |
Constant |
getOrNull(int n)
Get the nth entry in the constant pool, or
null if the index is in-range but invalid. |
void |
set(int n,
Constant cst)
Sets the entry at the given index. |
int |
size()
Get the "size" of the constant pool. |
| Methods inherited from class com.android.dx.util.MutabilityControl |
|---|
isImmutable, isMutable, setImmutable, throwIfImmutable, throwIfMutable |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StdConstantPool(int size)
null.
size - the size of the 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.| Method Detail |
|---|
public int size()
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.
size in interface ConstantPool>= 1; the sizepublic Constant getOrNull(int n)
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).
getOrNull in interface ConstantPooln - n >= 0, n < size(); the constant pool index
null-ok; the corresponding entry, or null if
the index is in-range but invalidpublic Constant get0Ok(int n)
nth entry in the constant pool, which must
be valid unless n == 0, in which case null
is returned.
get0Ok in interface ConstantPooln - n >= 0, n < size(); the constant pool index
null-ok; the corresponding entry, if n != 0public Constant get(int n)
nth entry in the constant pool, which must
be valid.
get in interface ConstantPooln - n >= 0, n < size(); the constant pool index
non-null; the corresponding entry
public void set(int n,
Constant cst)
n - >= 1, < size(); which entrycst - null-ok; the constant to store
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||