インタフェース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でない場合
-