Constant
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| protected Constant[] | constants
Deprecated
(since 6.0) will be made private; do not access directly, use getter/setter
|
| private final Map | |
| private static final int | |
| private static final String | |
| private static final String | |
| protected int | index
Deprecated
(since 6.0) will be made private; do not access directly, use getSize()
|
| private static final String | |
| private static final String | |
| private final Map | |
| protected int | size
Deprecated
(since 6.0) will be made private; do not access directly, use getter/setter
|
| private final Map | |
| private final Map |
| Access | Constructor and Description |
|---|---|
| public | |
| public | ConstantPoolGen(final Constant[]
array of given constants, new ones will be appended cs)Constructs a new instance with the given array of constants. |
| public | ConstantPoolGen(final ConstantPool
the constant pool. cp)Constructs a new instance with the given constant pool. |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: index of entrytype of array class type)Add a reference to an array class (e.g. String[][]) as needed by MULTIANEWARRAY instruction, e.g. to the ConstantPool. |
| public int | Returns: index of entryClass to add type)Add a new Class reference to the ConstantPool for a given type. |
| public int | |
| private int | |
| public int | Returns: index of entryThe constant to add. constant, final ConstantPoolGen Source pool. cpGen)Adds a constant from another ConstantPool and returns the new index. |
| public int | Returns: index of entryDouble number to add n)Add a new double constant to the ConstantPool, if it is not already in there. |
| public int | Returns: index of entryclass name string to add className, final String field name string to add fieldName, final String signature string to add signature)Add a new Fieldref constant to the ConstantPool, if it is not already in there. |
| public int | Returns: index of entryFloat number to add n)Add a new Float constant to the ConstantPool, if it is not already in there. |
| public int | Returns: index of entryinteger number to add n)Add a new Integer constant to the ConstantPool, if it is not already in there. |
| public int | |
| public int | Returns: index of entryclass name string to add className, final String method name string to add methodName, final String signature string to add signature)Add a new InterfaceMethodref constant to the ConstantPool, if it is not already in there. |
| public int | Returns: index of entryLong number to add n)Add a new long constant to the ConstantPool, if it is not already in there. |
| public int | |
| public int | Returns: index of entryclass name string to add className, final String method name string to add methodName, final String method signature string to add signature)Add a new Methodref constant to the ConstantPool, if it is not already in there. |
| public int | Returns: index of entryName string to add name, final String signature string to add signature)Add a new NameAndType constant to the ConstantPool if it is not already in there. |
| public int | |
| public int | |
| protected void | |
| private int | |
| public Constant | |
| public ConstantPool | |
| public ConstantPool | |
| private int | |
| public int | |
| public int | Returns: index on success, -1 otherwiseString to search for str)Look for ConstantClass in ConstantPool named 'str'. |
| public int | Returns: index on success, -1 otherwiseDouble number to look for n)Look for ConstantDouble in ConstantPool. |
| public int | Returns: index on success, -1 otherwiseWhere to find method className, final String Guess what fieldName, final String return and argument types signature)Look for ConstantFieldref in ConstantPool. |
| public int | Returns: index on success, -1 otherwiseFloat number to look for n)Look for ConstantFloat in ConstantPool. |
| public int | Returns: index on success, -1 otherwiseinteger number to look for n)Look for ConstantInteger in ConstantPool. |
| public int | |
| public int | Returns: index on success, -1 otherwiseWhere to find method className, final String Guess what methodName, final String return and argument types signature)Look for ConstantInterfaceMethodref in ConstantPool. |
| public int | Returns: index on success, -1 otherwiseLong number to look for n)Look for ConstantLong in ConstantPool. |
| public int | |
| public int | Returns: index on success, -1 otherwiseWhere to find method className, final String Guess what methodName, final String return and argument types signature)Look for ConstantMethodref in ConstantPool. |
| public int | Returns: index on success, -1 otherwiseof variable/method name, final String of variable/method signature)Look for ConstantNameAndType in ConstantPool. |
| public int | Returns: index on success, -1 otherwiseString to search for str)Look for ConstantString in ConstantPool containing String 'str'. |
| public int | Returns: index on success, -1 otherwiseUtf8 string to look for n)Look for ConstantUtf8 in ConstantPool. |
| public void | setConstant(final int
index in constant pool i, final Constant new constant pool entry at index i c)Use with care! |
| private int | |
| public String | Returns: String representation.Overrides java. Returns a string representation of the object. |
| classTable | back to summary |
|---|---|
| private final Map<String, Integer> classTable | |
| constants | back to summary |
|---|---|
| protected Constant[] constants
Deprecated (since 6.0) will be made private; do not access directly, use getter/setter | |
| cpTable | back to summary |
|---|---|
| private final Map<String, Integer> cpTable | |
| DEFAULT_BUFFER_SIZE | back to summary |
|---|---|
| private static final int DEFAULT_BUFFER_SIZE | |
| FIELDREF_DELIM | back to summary |
|---|---|
| private static final String FIELDREF_DELIM | |
| IMETHODREF_DELIM | back to summary |
|---|---|
| private static final String IMETHODREF_DELIM | |
| index | back to summary |
|---|---|
| protected int index
Deprecated (since 6.0) will be made private; do not access directly, use getSize() | |
| METHODREF_DELIM | back to summary |
|---|---|
| private static final String METHODREF_DELIM | |
| NAT_DELIM | back to summary |
|---|---|
| private static final String NAT_DELIM | |
| natTable | back to summary |
|---|---|
| private final Map<String, Integer> natTable | |
| size | back to summary |
|---|---|
| protected int size
Deprecated (since 6.0) will be made private; do not access directly, use getter/setter | |
| stringTable | back to summary |
|---|---|
| private final Map<String, Integer> stringTable | |
| utf8Table | back to summary |
|---|---|
| private final Map<String, Integer> utf8Table | |
| ConstantPoolGen | back to summary |
|---|---|
| public ConstantPoolGen() Constructs a new empty constant pool. | |
| ConstantPoolGen | back to summary |
|---|---|
| public ConstantPoolGen(final Constant[] cs) Constructs a new instance with the given array of constants.
| |
| ConstantPoolGen | back to summary |
|---|---|
| public ConstantPoolGen(final ConstantPool cp) Constructs a new instance with the given constant pool.
| |
| addArrayClass | back to summary |
|---|---|
| public int addArrayClass(final ArrayType type) Add a reference to an array class (e.g. String[][]) as needed by MULTIANEWARRAY instruction, e.g. to the ConstantPool.
| |
| addClass | back to summary |
|---|---|
| public int addClass(final ObjectType type) Add a new Class reference to the ConstantPool for a given type.
| |
| addClass | back to summary |
|---|---|
| public int addClass(final String str) Add a new Class reference to the ConstantPool, if it is not already in there.
| |
| addClass_ | back to summary |
|---|---|
| private int addClass_(final String clazz) | |
| addConstant | back to summary |
|---|---|
| public int addConstant(final Constant constant, final ConstantPoolGen cpGen) Adds a constant from another ConstantPool and returns the new index.
| |
| addDouble | back to summary |
|---|---|
| public int addDouble(final double n) Add a new double constant to the ConstantPool, if it is not already in there.
| |
| addFieldref | back to summary |
|---|---|
| public int addFieldref(final String className, final String fieldName, final String signature) Add a new Fieldref constant to the ConstantPool, if it is not already in there. | |
| addFloat | back to summary |
|---|---|
| public int addFloat(final float n) Add a new Float constant to the ConstantPool, if it is not already in there.
| |
| addInteger | back to summary |
|---|---|
| public int addInteger(final int n) Add a new Integer constant to the ConstantPool, if it is not already in there.
| |
| addInterfaceMethodref | back to summary |
|---|---|
| public int addInterfaceMethodref(final MethodGen method) | |
| addInterfaceMethodref | back to summary |
|---|---|
| public int addInterfaceMethodref(final String className, final String methodName, final String signature) Add a new InterfaceMethodref constant to the ConstantPool, if it is not already in there. | |
| addLong | back to summary |
|---|---|
| public int addLong(final long n) Add a new long constant to the ConstantPool, if it is not already in there.
| |
| addMethodref | back to summary |
|---|---|
| public int addMethodref(final MethodGen method) | |
| addMethodref | back to summary |
|---|---|
| public int addMethodref(final String className, final String methodName, final String signature) Add a new Methodref constant to the ConstantPool, if it is not already in there. | |
| addNameAndType | back to summary |
|---|---|
| public int addNameAndType(final String name, final String signature) Add a new NameAndType constant to the ConstantPool if it is not already in there. | |
| addString | back to summary |
|---|---|
| public int addString(final String str) Add a new String constant to the ConstantPool, if it is not already in there.
| |
| addUtf8 | back to summary |
|---|---|
| public int addUtf8(final String n) Add a new Utf8 constant to the ConstantPool, if it is not already in there.
| |
| adjustSize | back to summary |
|---|---|
| protected void adjustSize() Resize internal array of constants. | |
| computeIfAbsent | back to summary |
|---|---|
| private int computeIfAbsent(final Map<String, Integer> map, final String key, final int value) | |
| getConstant | back to summary |
|---|---|
public Constant getConstant(final int i)
| |
| getConstantPool | back to summary |
|---|---|
public ConstantPool getConstantPool()
| |
| getFinalConstantPool | back to summary |
|---|---|
public ConstantPool getFinalConstantPool()
| |
| getIndex | back to summary |
|---|---|
| private int getIndex(final Map<String, Integer> map, final String key) | |
| getSize | back to summary |
|---|---|
public int getSize()
| |
| lookupClass | back to summary |
|---|---|
| public int lookupClass(final String str) Look for ConstantClass in ConstantPool named 'str'.
| |
| lookupDouble | back to summary |
|---|---|
| public int lookupDouble(final double n) Look for ConstantDouble in ConstantPool.
| |
| lookupFieldref | back to summary |
|---|---|
| public int lookupFieldref(final String className, final String fieldName, final String signature) Look for ConstantFieldref in ConstantPool. | |
| lookupFloat | back to summary |
|---|---|
| public int lookupFloat(final float n) Look for ConstantFloat in ConstantPool.
| |
| lookupInteger | back to summary |
|---|---|
| public int lookupInteger(final int n) Look for ConstantInteger in ConstantPool.
| |
| lookupInterfaceMethodref | back to summary |
|---|---|
| public int lookupInterfaceMethodref(final MethodGen method) | |
| lookupInterfaceMethodref | back to summary |
|---|---|
| public int lookupInterfaceMethodref(final String className, final String methodName, final String signature) Look for ConstantInterfaceMethodref in ConstantPool. | |
| lookupLong | back to summary |
|---|---|
| public int lookupLong(final long n) Look for ConstantLong in ConstantPool.
| |
| lookupMethodref | back to summary |
|---|---|
| public int lookupMethodref(final MethodGen method) | |
| lookupMethodref | back to summary |
|---|---|
| public int lookupMethodref(final String className, final String methodName, final String signature) Look for ConstantMethodref in ConstantPool. | |
| lookupNameAndType | back to summary |
|---|---|
| public int lookupNameAndType(final String name, final String signature) Look for ConstantNameAndType in ConstantPool. | |
| lookupString | back to summary |
|---|---|
| public int lookupString(final String str) Look for ConstantString in ConstantPool containing String 'str'.
| |
| lookupUtf8 | back to summary |
|---|---|
| public int lookupUtf8(final String n) Look for ConstantUtf8 in ConstantPool.
| |
| setConstant | back to summary |
|---|---|
| public void setConstant(final int i, final Constant c) Use with care!
| |
| toIndex | back to summary |
|---|---|
| private int toIndex(final Integer index) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |