public interface ConstantPool
Constant objects.| Modifier and Type | Method and Description |
|---|---|
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[] |
getEntries()
Get all entries in this constant pool.
|
Constant |
getOrNull(int n)
Get the
nth entry in the constant pool, or
null if the index is in-range but invalid. |
int |
size()
Get the "size" of the constant pool.
|
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.>= 1; the sizeConstant get(int n)
nth entry in the constant pool, which must
be valid.n - n >= 0, n < size(); the constant pool indexnon-null; the corresponding entryjava.lang.IllegalArgumentException - thrown if n is
in-range but invalidConstant get0Ok(int n)
nth entry in the constant pool, which must
be valid unless n == 0, in which case null
is returned.n - n >= 0, n < size(); the constant pool indexnull-ok; the corresponding entry, if n != 0java.lang.IllegalArgumentException - thrown if n is
in-range and non-zero but invalidConstant 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).n - n >= 0, n < size(); the constant pool indexnull-ok; the corresponding entry, or null if
the index is in-range but invalidConstant[] getEntries()
Copyright © 2020. All Rights Reserved.