ConstantPool

A ConstantPool is a list of ConstantPoolEntrys We store data inside the ConstantPool. This has the advantage that we can reference to the data by an index. Double-used data will only be stored once, and we can reference to it by the index.

Specification

Since

0.1.0

Parameters

entries

The entries of the ConstantPool

Inheritors

Constructors

Link copied to clipboard
constructor(entries: List<ConstantPoolEntry>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The entries of the ConstantPool

Link copied to clipboard
open override val size: Int

Functions

Link copied to clipboard
open operator override fun contains(element: ConstantPoolEntry): Boolean
Link copied to clipboard
open override fun containsAll(elements: Collection<ConstantPoolEntry>): Boolean
Link copied to clipboard

Dump the ConstantPool to a ByteArray

fun dump(stream: DataOutputStream)

Dump the ConstantPool to the given stream

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Check if the ConstantPool is equal to the given other object

Link copied to clipboard
fun findByte(value: Byte): Int?

Find the ConstantPoolEntry.ByteConstant with the given value

Link copied to clipboard
fun findClass(identifier: Int): Int?
fun findClass(name: String): Int?

Find the ConstantPoolEntry.ClassConstant with the given name

Link copied to clipboard
fun findDouble(value: Double): Int?

Find the ConstantPoolEntry.DoubleConstant with the given value

Link copied to clipboard
fun findFloat(value: Float): Int?

Find the ConstantPoolEntry.FloatConstant with the given value

Link copied to clipboard
fun findInt(value: Int): Int?

Find the ConstantPoolEntry.IntConstant with the given value

Link copied to clipboard
fun findLong(value: Long): Int?

Find the ConstantPoolEntry.LongConstant with the given value

Link copied to clipboard
fun findShort(value: Short): Int?

Find the ConstantPoolEntry.ShortConstant with the given value

Link copied to clipboard
fun findString(value: Int): Int?
fun findString(value: String): Int?

Find the ConstantPoolEntry.StringConstant with the given value

Link copied to clipboard
fun findUtf8(value: String): Int?

Find the ConstantPoolEntry.Utf8Constant with the given value

Link copied to clipboard
open operator override fun get(index: Int): ConstantPoolEntry
Link copied to clipboard

Get the constant at the given index as a ConstantPoolEntry.ByteConstant

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Get the constant at the given index as a ConstantPoolEntry.IntConstant

Link copied to clipboard

Get the constant at the given index as a ConstantPoolEntry.LongConstant

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Get the constant at the given identifier as a ConstantPoolEntry.Utf8Constant

Link copied to clipboard
open override fun hashCode(): Int

Get the hashCode of the ConstantPool

Link copied to clipboard
open override fun indexOf(element: ConstantPoolEntry): Int
Link copied to clipboard
fun isByte(index: Int): Boolean

Check if the constant at the given index is a ConstantPoolEntry.ByteConstant

Link copied to clipboard
fun isClass(index: Int): Boolean

Check if the constant at the given index is a ConstantPoolEntry.ClassConstant

Link copied to clipboard
fun isDouble(index: Int): Boolean

Check if the constant at the given index is a ConstantPoolEntry.DoubleConstant

Link copied to clipboard
open override fun isEmpty(): Boolean
Link copied to clipboard
fun isFloat(index: Int): Boolean

Check if the constant at the given index is a ConstantPoolEntry.FloatConstant

Link copied to clipboard
fun isInt(index: Int): Boolean

Check if the constant at the given index is a ConstantPoolEntry.IntConstant

Link copied to clipboard
fun isLong(index: Int): Boolean

Check if the constant at the given index is a ConstantPoolEntry.LongConstant

Link copied to clipboard
fun isShort(index: Int): Boolean

Check if the constant at the given index is a ConstantPoolEntry.ShortConstant

Link copied to clipboard
fun isString(index: Int): Boolean

Check if the constant at the given index is a ConstantPoolEntry.StringConstant

Link copied to clipboard
fun isUtf8(index: Int): Boolean

Check if the constant at the given index is a ConstantPoolEntry.Utf8Constant

Link copied to clipboard
open operator override fun iterator(): Iterator<ConstantPoolEntry>
Link copied to clipboard
open override fun lastIndexOf(element: ConstantPoolEntry): Int
Link copied to clipboard
Link copied to clipboard
open override fun subList(fromIndex: Int, toIndex: Int): List<ConstantPoolEntry>
Link copied to clipboard
open override fun toString(): String

Get the string representation of the ConstantPool