- すべてのスーパー・インタフェース:
ClassFileElementPREVIEW
,CodeElementPREVIEW
,InstructionPREVIEW
- 既知のすべてのサブインタフェース:
ConstantInstruction.ArgumentConstantInstructionPREVIEW
,ConstantInstruction.IntrinsicConstantInstructionPREVIEW
,ConstantInstruction.LoadConstantInstructionPREVIEW
public sealed interface ConstantInstruction extends InstructionPREVIEW permits ConstantInstruction.IntrinsicConstantInstructionPREVIEW, ConstantInstruction.ArgumentConstantInstructionPREVIEW, ConstantInstruction.LoadConstantInstructionPREVIEW
ConstantInstruction
は、JavaプラットフォームのプレビューAPIです。
プレビュー機能は、今後のリリースで削除するか、Javaプラットフォームの永続機能にアップグレードすることができます。
"intrinsic constant"命令(e.g.,
iconst_0
)、"argument constant"命令(e.g., bipush
)、"load constant"命令(e.g., LDC
)など、 Code
属性のcode
配列内の定数ロード命令をモデル化します。 対応するopcodeのkind
は、Opcode.Kind.CONSTANT
PREVIEWになります。 CodeModel
PREVIEWの要素をトラバースするときに、CodeElement
PREVIEWとして提供されます。 - 導入されたバージョン:
- 22
-
ネストされたクラスのサマリー
修飾子と型インタフェース説明static interface
Preview."argument constant"命令(e.g.,bipush
)をモデル化します。static interface
Preview."intrinsic constant"命令(e.g.,iconst_0
)をモデル化します。static interface
Preview."load constant"命令(e.g.,ldc
)をモデル化します。 -
メソッドのサマリー
修飾子と型メソッド説明定数値を返します。ofArgument
(OpcodePREVIEW op, int value) 引数定数命令を返します。組み込み定数命令を返します。ofLoad
(OpcodePREVIEW op, LoadableConstantEntryPREVIEW constant) ロード定数命令を返します。typeKind()
定数の型を返します。インタフェースjava.lang.classfile.InstructionPREVIEWで宣言されたメソッド
opcode, sizeInBytes
-
メソッドの詳細
-
constantValue
-
typeKind
-
ofIntrinsic
static ConstantInstruction.IntrinsicConstantInstructionPREVIEW ofIntrinsic(OpcodePREVIEW op) 組み込み定数命令を返します。- パラメータ:
op
- 固有定数命令の特定のタイプのopcode。Opcode.Kind.CONSTANT
PREVIEW型である必要があります- 戻り値:
- 組み込み定数命令
-
ofArgument
static ConstantInstruction.ArgumentConstantInstructionPREVIEW ofArgument(OpcodePREVIEW op, int value) 引数定数命令を返します。- パラメータ:
op
- 固有定数命令の特定のタイプのopcode。Opcode.Kind.CONSTANT
PREVIEW型である必要がありますvalue
- 定数値- 戻り値:
- 引数定数命令
-
ofLoad
static ConstantInstruction.LoadConstantInstructionPREVIEW ofLoad(OpcodePREVIEW op, LoadableConstantEntryPREVIEW constant) ロード定数命令を返します。- パラメータ:
op
- 特定のタイプのロード定数命令のopcode。Opcode.Kind.CONSTANT
PREVIEW型である必要がありますconstant
- 定数値- 戻り値:
- ロード定数命令
-
ConstantInstruction
を使用できます。