Class XmlInstruction
- java.lang.Object
-
- org.eolang.jeo.representation.xmir.XmlInstruction
-
- All Implemented Interfaces:
XmlBytecodeEntry
public final class XmlInstruction extends Object implements XmlBytecodeEntry
Bytecode instruction from XML.- Since:
- 0.1
-
-
Constructor Summary
Constructors Constructor Description XmlInstruction(int opcode, Object... args)
Constructor.XmlInstruction(String xml)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object[]
arguments()
Instruction arguments.boolean
equals(Object other)
int
hashCode()
boolean
hasOpcode(int opcode)
Check if instruction has opcode.Node
node()
Xml node.void
replaceArguementsValues(String old, String replacement)
Replace values of instruction arguments.String
toString()
void
writeTo(BytecodeMethod method)
Write instruction to the bytecode method.
-
-
-
Method Detail
-
writeTo
public void writeTo(BytecodeMethod method)
Description copied from interface:XmlBytecodeEntry
Write instruction to the bytecode method.- Specified by:
writeTo
in interfaceXmlBytecodeEntry
- Parameters:
method
- Bytecode Method where instruction should be written.
-
hasOpcode
public boolean hasOpcode(int opcode)
Description copied from interface:XmlBytecodeEntry
Check if instruction has opcode.- Specified by:
hasOpcode
in interfaceXmlBytecodeEntry
- Parameters:
opcode
- Opcode comparing with.- Returns:
- True if instruction has opcode.
-
replaceArguementsValues
public void replaceArguementsValues(String old, String replacement)
Description copied from interface:XmlBytecodeEntry
Replace values of instruction arguments.- Specified by:
replaceArguementsValues
in interfaceXmlBytecodeEntry
- Parameters:
old
- Old value.replacement
- Which value to set instead.
-
arguments
public Object[] arguments()
Instruction arguments.- Returns:
- Arguments.
-
node
public Node node()
Description copied from interface:XmlBytecodeEntry
Xml node.- Specified by:
node
in interfaceXmlBytecodeEntry
- Returns:
- Xml node.
-
-