Package org.eolang.opeo
Class OpcodeInstruction
- java.lang.Object
-
- org.eolang.opeo.OpcodeInstruction
-
- All Implemented Interfaces:
Instruction
public final class OpcodeInstruction extends Object implements Instruction
Instruction that was created directly in Java code. This class is useful for testing purposes. In real scenarios we mostly useJeoInstruction.- Since:
- 0.1
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eolang.opeo.Instruction
Instruction.Nop
-
-
Constructor Summary
Constructors Constructor Description OpcodeInstruction(int code, Object... args)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intopcode()Opcode number.Objectoperand(int index)Retrieve operand by position index.List<Object>operands()Full list of operands.
-
-
-
Constructor Detail
-
OpcodeInstruction
public OpcodeInstruction(int code, Object... args)Constructor.- Parameters:
code- Opcode indexargs- Operands
-
-
Method Detail
-
opcode
public int opcode()
Description copied from interface:InstructionOpcode number.- Specified by:
opcodein interfaceInstruction- Returns:
- Opcode number.
-
operand
public Object operand(int index)
Description copied from interface:InstructionRetrieve operand by position index.- Specified by:
operandin interfaceInstruction- Parameters:
index- Operand index- Returns:
- Operand
-
operands
public List<Object> operands()
Description copied from interface:InstructionFull list of operands.- Specified by:
operandsin interfaceInstruction- Returns:
- Operands.
-
-