Home Reference Source
import {ConstantPool} from 'jvm/lib/core/jvm/ConstantPool.js'
public class | source

ConstantPool

Wrapper around the JVM Class File's Constant Pool table.

It provides simplified access to the elements contained in the Constant Pool while.

See:

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

pool: {Array<Object>

public get

size: Number: *

The total size of the Constant Pool.

Method Summary

Public Methods
public

at(idx: Number): Object | false

The 1-based index into the Constant Pool for which you wish to retrieve the entry from.

public

find(criteria: Object): Object | undefined

Attempts to find the first entry in the pool matching the specified criteria going from the first index to the last.

public

Serialized version of this class without circular references.

public

Decodes the entry's value at the Constant Pool index specified.

Public Constructors

public constructor(pool: Array<Object>) source

Params:

NameTypeAttributeDescription
pool Array<Object>

Public Members

public pool: {Array<Object> source

public get size: Number: * source

The total size of the Constant Pool.

Return:

Number

Public Methods

public at(idx: Number): Object | false source

The 1-based index into the Constant Pool for which you wish to retrieve the entry from.

Indices MUST be: 1 ≤ index ≤ ConstantPool#size

Params:

NameTypeAttributeDescription
idx Number

Return:

Object | false

returns false if the index passed is the second half (empty) of a Double or Long entry in the Constant Pool. See the Oracle link below for more information.

See:

public find(criteria: Object): Object | undefined source

Attempts to find the first entry in the pool matching the specified criteria going from the first index to the last.

Params:

NameTypeAttributeDescription
criteria Object

Search criteria

Return:

Object | undefined

returns undefined if no match could be found

See:

public toObject(): Object source

Serialized version of this class without circular references.

Return:

Object

public valueAt(idx: Number): Number | string | undefined source

Decodes the entry's value at the Constant Pool index specified.

Params:

NameTypeAttributeDescription
idx Number

index of the entry to decode.

Return:

Number | string | undefined

returns undefined if the entry was not able to be decoded.