インタフェースConstantInstruction
- すべてのスーパー・インタフェース:
ClassFileElement
,CodeElement
,Instruction
- 既知のすべてのサブインタフェース:
ConstantInstruction.ArgumentConstantInstruction
,ConstantInstruction.IntrinsicConstantInstruction
,ConstantInstruction.LoadConstantInstruction
public sealed interface ConstantInstruction extends Instruction permits ConstantInstruction.IntrinsicConstantInstruction, ConstantInstruction.ArgumentConstantInstruction, ConstantInstruction.LoadConstantInstruction
"intrinsic"、"argument"、"load"定数命令など、
Code
属性のcode
配列の定数ロード命令をモデル化します。 対応するopcodesのkindはOpcode.Kind.CONSTANT
です。 CodeModel
の要素をトラバースするときに、CodeElement
として提供されます。
ロードされた定数値は、ConstantDesc
として象徴的に表されます:
ConstantInstruction
(ConstantDesc constantValue
)
-
ネストされたクラスのサマリー
ネストされたクラス修飾子と型インタフェース説明static interface
命令の定数値を直接エンコードする"引数定数"命令をモデル化します。static interface
定数値をopcodeにエンコードする"組み込み定数"命令をモデル化します。static interface
定数値を定数プールにエンコードする"ロード定数"命令をモデル化します。 -
メソッドのサマリー
修飾子と型メソッド説明定数値を返します。ofArgument
(Opcode op, int value) 引数定数命令を返します。ofIntrinsic
(Opcode op) 組み込み定数命令を返します。ofLoad
(Opcode op, LoadableConstantEntry constant) ロード定数命令を返します。typeKind()
定数の「計算タイプ」を返します。インタフェースjava.lang.classfile.Instructionで宣言されたメソッド
opcode, sizeInBytes
-
メソッドの詳細
-
constantValue
-
typeKind
-
ofIntrinsic
static ConstantInstruction.IntrinsicConstantInstruction ofIntrinsic(Opcode op) 組み込み定数命令を返します。- パラメータ:
op
- 固有定数命令の特定のタイプのopcode。Opcode.Kind.CONSTANT
の種類である必要があります- 戻り値:
- 組み込み定数命令
- スロー:
IllegalArgumentException
- opcodeが暗黙的な値を持つ定数を表していない場合
-
ofArgument
static ConstantInstruction.ArgumentConstantInstruction ofArgument(Opcode op, int value) 引数定数命令を返します。value
は、byte
、[-128, 127]
、Opcode.BIPUSH
、short
、[-32768, 32767]
、Opcode.SIPUSH
の範囲内である必要があります。- パラメータ:
op
- 特定の型の引数定数命令のopcode。Opcode.BIPUSH
またはOpcode.SIPUSH
である必要がありますvalue
- 定数値- 戻り値:
- 引数定数命令
- スロー:
IllegalArgumentException
- opcodeがOpcode.BIPUSH
またはOpcode.SIPUSH
でない場合、またはopcodeの定数値が範囲外の場合
-
ofLoad
static ConstantInstruction.LoadConstantInstruction ofLoad(Opcode op, LoadableConstantEntry constant) ロード定数命令を返します。- パラメータ:
op
- 特定のタイプのロード定数命令のopcode。Opcode.Kind.CONSTANT
の種類である必要がありますconstant
- 定数値- 戻り値:
- ロード定数命令
- スロー:
IllegalArgumentException
- opcodeがOpcode.LDC
、Opcode.LDC_W
またはOpcode.LDC2_W
でない場合
-