APIdia Launch Partner
Top Description Methods
java.lang.classfile.instruction

public sealed Interface NewMultiArrayInstruction

extends Instruction
permits BoundNewMultidimensionalArrayInstruction, UnboundNewMultidimensionalArrayInstruction
Known Direct Implementers
jdk.internal.classfile.impl.AbstractInstruction.BoundNewMultidimensionalArrayInstruction, jdk.internal.classfile.impl.AbstractInstruction.UnboundNewMultidimensionalArrayInstruction
Imports
java.lang.classfile.CodeBuilder, .CodeElement, .CodeModel, .Instruction, .Opcode, java.lang.classfile.constantpool.ClassEntry, jdk.internal.classfile.impl.AbstractInstruction, .BytecodeHelpers

Models a multianewarray instruction in the code array of a Code attribute. Delivered as a CodeElement when traversing the elements of a CodeModel.

A new multi-dimensional array instruction is composite:

NewMultiArrayInstruction( ClassEntry arrayType, int dimensions )
NewMultiArrayInstruction(
    ClassEntry arrayType,
    int dimensions
)
where the arrayType is an array class.
Since
24
Java Virtual Machine Specification
6.5.multianewarray multianewarray
See Also
Opcode.Kind#NEW_MULTI_ARRAY, CodeBuilder::multianewarray

Method Summary

Modifier and TypeMethod and Description
public ClassEntry

Returns:

the type of the array
arrayType
()

Returns the type of the array.

public int

Returns:

the number of dimensions of the array
dimensions
()

Returns the number of dimensions of the array.

public static NewMultiArrayInstruction

Returns:

a new multi-dimensional array instruction
of
(ClassEntry
the type of the array
arrayTypeEntry
,
int
the number of dimensions of the array
dimensions
)

Returns a new multi-dimensional array instruction.

Inherited from java.lang.classfile.Instruction:
opcodesizeInBytes

Method Detail

arrayTypeback to summary
public ClassEntry arrayType()

Returns the type of the array.

Returns:ClassEntry

the type of the array

dimensionsback to summary
public int dimensions()

Returns the number of dimensions of the array.

Returns:int

the number of dimensions of the array

ofback to summary
public static NewMultiArrayInstruction of(ClassEntry arrayTypeEntry, int dimensions)

Returns a new multi-dimensional array instruction.

Parameters
arrayTypeEntry:ClassEntry

the type of the array

dimensions:int

the number of dimensions of the array

Returns:NewMultiArrayInstruction

a new multi-dimensional array instruction

Exceptions
IllegalArgumentException:
if dimensions is out of range