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 int
opcode()
Opcode number.Object
operand(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:Instruction
Opcode number.- Specified by:
opcode
in interfaceInstruction
- Returns:
- Opcode number.
-
operand
public Object operand(int index)
Description copied from interface:Instruction
Retrieve operand by position index.- Specified by:
operand
in interfaceInstruction
- Parameters:
index
- Operand index- Returns:
- Operand
-
operands
public List<Object> operands()
Description copied from interface:Instruction
Full list of operands.- Specified by:
operands
in interfaceInstruction
- Returns:
- Operands.
-
-