Package Torello.Java.Additional
Class ConstantPool.Dynamic
- java.lang.Object
-
- Torello.Java.Additional.ConstantPool.Dynamic
-
- Enclosing class:
- ConstantPool
public static class ConstantPool.Dynamic extends java.lang.Object
Used to represent Java'.class'
File Constant's whose Tag-Kind is:
Hi-Lited Source-Code:- View Here: Torello/Java/Additional/ConstantPool.java
- Open New Browser-Tab: Torello/Java/Additional/ConstantPool.java
File Size: 8,175 Bytes Line Count: 181 '\n' Characters Found
-
-
Field Summary
Method-Name, and location in the Constant-Pool Table Modifier and Type Field Description String
name
This stores the Method-Name of the Bootstrap-Method specified by this Method-Handle instance.int
tableIndex
The Constant-Pool Table-Index where thisReference
is locatedTag-Kind - first as a 'byte', but also as a 'boolean' Modifier and Type Field Description boolean
dynamicOrInvokeDynamic
byte
tag
The Constant-Pool Tg-Kind associated with this instance.Bootstrap-Method Table-Index for this 'Dynamic' Record Modifier and Type Field Description int
bootstrapMethodIndex
The index into the Bootstrap Method Table, pointing to a bootstrap method definition in the `.class` file attributes.Relevant Record Indices within the Table Modifier and Type Field Description int
nameAndTypeIndex
The index into the constant pool, pointing to aConstantPool.TAG_NAME_AND_TYPE
Record / Structure that provides the name and type descriptor of this entry.int
nameIndex
The Constant in the Constant-Pool which may be found at the index specified by fieldnameAndTypeIndex
is, itself, a "Record" of sorts; and contains two integer data fields in its Record.int
typeIndex
This stores the Java 'type' for a Method-Handle as a Constant.
-
Method Summary
Methods: class java.lang.Object Modifier and Type Method Description boolean
equals(Object other)
Check whether this instance equals parameter'other'
int
hashCode()
Generate a simple, efficient, hash-code for this instance.String
toString()
Generate aString
representation for this instance.
-
-
-
Field Detail
-
tableIndex
public final int tableIndex
The Constant-Pool Table-Index where thisReference
is located- Code:
- Exact Field Declaration Expression:
public final int tableIndex;
-
tag
public final byte tag
The Constant-Pool Tg-Kind associated with this instance. This Java'byte'
may take one of only two values:
The "Tag-Kind" for any Constant in a Java'.class'
File's Constant-Pool are abyte
-Value which occupies the first byte of the constant's definition in thebyte[]
-Array which was loaded from disk.- Code:
- Exact Field Declaration Expression:
public final byte tag;
-
dynamicOrInvokeDynamic
public final boolean dynamicOrInvokeDynamic
This field will be assignedTRUE
if-and-only-if fieldtag
has been assigned17
. Tthe only other value which may be assigned to fieldtag
is18
, when that field is equal to18
, this field beFALSE
.boolean
fields such as this are here purely to make life easier, occasionally.- Code:
- Exact Field Declaration Expression:
public final boolean dynamicOrInvokeDynamic;
-
bootstrapMethodIndex
public final int bootstrapMethodIndex
The index into the Bootstrap Method Table, pointing to a bootstrap method definition in the `.class` file attributes.- Code:
- Exact Field Declaration Expression:
public final int bootstrapMethodIndex;
-
nameAndTypeIndex
public final int nameAndTypeIndex
The index into the constant pool, pointing to aConstantPool.TAG_NAME_AND_TYPE
Record / Structure that provides the name and type descriptor of this entry.
The Constant-Pool entry that is stored in the Table-Index specified by the integer in'nameAndTypeIndex'
is actually a 4 Byte Integer-Pair. The two integers that comprise a "Name And Type" Constant (a "record" or "Structure") are simply two Index-Pointers back into the Constant-Pool's Table.
The first Index-Pointer is to aUTF-8 String
storing the "name" of for the Method of the Method-Handle. The second Index-Poniter points to a Table-Index which contains the Method-Type - also stored as aUTF-8 String
.- Code:
- Exact Field Declaration Expression:
public final int nameAndTypeIndex;
-
nameIndex
public final int nameIndex
The Constant in the Constant-Pool which may be found at the index specified by fieldnameAndTypeIndex
is, itself, a "Record" of sorts; and contains two integer data fields in its Record. The first integer is a Table Index-Pointer to a "name", and is represented by aUTF-8
Table-Constant.
The Constant-Pool Table-Index for theUTF-8 String
Constanta is saved as an integer in thispublic, final
field.
The second integer of the Two-Integer Data-Record (nameAndTypeIndex
) stores a "Type as a String." The index for thatUTF-8 String
is stored in thepublic final
fieldtypeIndex
.- Code:
- Exact Field Declaration Expression:
public final int nameIndex;
-
typeIndex
public final int typeIndex
This stores the Java 'type' for a Method-Handle as a Constant. You should review the documented explanations for the fieldsnameAndTypeIndex
and also fornameIndex
for more information.- Code:
- Exact Field Declaration Expression:
public final int typeIndex;
-
name
public final java.lang.String name
This stores the Method-Name of the Bootstrap-Method specified by this Method-Handle instance.- Code:
- Exact Field Declaration Expression:
public final String name;
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object other)
Check whether this instance equals parameter'other'
- Overrides:
equals
in classjava.lang.Object
- Code:
- Exact Method Body:
if (! (other instanceof ConstantPool.Dynamic)) return false; ConstantPool.Dynamic o = (ConstantPool.Dynamic) other; return (this.tableIndex == o.tableIndex) && (this.tag == o.tag) && (this.dynamicOrInvokeDynamic == o.dynamicOrInvokeDynamic) && (this.bootstrapMethodIndex == o.bootstrapMethodIndex) && (this.nameAndTypeIndex == o.nameAndTypeIndex) && (this.nameIndex == o.nameIndex) && (this.typeIndex == o.typeIndex) && Objects.equals(this.name, o.name);
-
hashCode
public int hashCode()
Generate a simple, efficient, hash-code for this instance.- Overrides:
hashCode
in classjava.lang.Object
- Code:
- Exact Method Body:
return this.tableIndex + this.bootstrapMethodIndex + this.nameAndTypeIndex;
-
toString
public java.lang.String toString()
Generate ajava.lang.String
representation for this instance.- Overrides:
toString
in classjava.lang.Object
- Code:
- Exact Method Body:
return "{\n" + " tableIndex: " + tableIndex + "\n" + " tag: " + tag + " (" + (dynamicOrInvokeDynamic ? "Dynamic" : "Invoke-Dynamic") + ")\n" + " dynamicOrInvokeDynamic: " + dynamicOrInvokeDynamic + "\n" + " name: " + name + "\n" + " bootstrapMethodIndex: " + bootstrapMethodIndex + "\n" + " nameAndTypeIndex: " + nameAndTypeIndex + "\n" + " nameIndex: " + nameIndex + "\n" + " typeIndex: " + typeIndex + "\n" + "}";
-
-