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 StringnameThis stores the Method-Name of the Bootstrap-Method specified by this Method-Handle instance.inttableIndexThe Constant-Pool Table-Index where thisReferenceis locatedTag-Kind - first as a 'byte', but also as a 'boolean' Modifier and Type Field Description booleandynamicOrInvokeDynamicbytetagThe Constant-Pool Tg-Kind associated with this instance.Bootstrap-Method Table-Index for this 'Dynamic' Record Modifier and Type Field Description intbootstrapMethodIndexThe 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 intnameAndTypeIndexThe index into the constant pool, pointing to aConstantPool.TAG_NAME_AND_TYPERecord / Structure that provides the name and type descriptor of this entry.intnameIndexThe Constant in the Constant-Pool which may be found at the index specified by fieldnameAndTypeIndexis, itself, a "Record" of sorts; and contains two integer data fields in its Record.inttypeIndexThis stores the Java 'type' for a Method-Handle as a Constant.
-
Method Summary
Methods: class java.lang.Object Modifier and Type Method Description booleanequals(Object other)Check whether this instance equals parameter'other'inthashCode()Generate a simple, efficient, hash-code for this instance.StringtoString()Generate aStringrepresentation for this instance.
-
-
-
Field Detail
-
tableIndex
public final int tableIndex
The Constant-Pool Table-Index where thisReferenceis located
-
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.
-
dynamicOrInvokeDynamic
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.
-
nameAndTypeIndex
public final int nameAndTypeIndex
The index into the constant pool, pointing to aConstantPool.TAG_NAME_AND_TYPERecord / 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 Stringstoring 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.
-
nameIndex
public final int nameIndex
The Constant in the Constant-Pool which may be found at the index specified by fieldnameAndTypeIndexis, 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-8Table-Constant.
The Constant-Pool Table-Index for theUTF-8 StringConstanta is saved as an integer in thispublic, finalfield.
The second integer of the Two-Integer Data-Record (nameAndTypeIndex) stores a "Type as a String." The index for thatUTF-8 Stringis stored in thepublic finalfieldtypeIndex.
-
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 fieldsnameAndTypeIndexand also fornameIndexfor more information.
-
name
public final java.lang.String name
This stores the Method-Name of the Bootstrap-Method specified by this Method-Handle instance.
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object other)
Check whether this instance equals parameter'other'- Overrides:
equalsin 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:
hashCodein classjava.lang.Object- Code:
- Exact Method Body:
return this.tableIndex + this.bootstrapMethodIndex + this.nameAndTypeIndex;
-
toString
public java.lang.String toString()
Generate ajava.lang.Stringrepresentation for this instance.- Overrides:
toStringin 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" + "}";
-
-