|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectInstruction
public class Instruction
This class represents one Darwin instruction. Instructions contain two parts: an opcode and an address. For instructions that do not perform jumps (hop, left, right, infect), the address part is not used. The fill instruction set is the following:
hop left right infect ifempty ifwall ifsame ifenemy ifrandom goThe following instructions require a target address to jump to:
ifempty, ifwall, ifsame, ifenemy, ifrandom, go
Field Summary | |
---|---|
static int |
GO
opcode for the go instruction |
static int |
HOP
opcode for the hop instruction |
static int |
IFEMPTY
opcode for the ifempty instruction |
static int |
IFENEMY
opcode for the ifenemy instruction |
static int |
IFRANDOM
opcode for the ifrandom instruction |
static int |
IFSAME
opcode for the ifsame instruction |
static int |
IFWALL
opcode for the ifwall instruction |
static int |
INFECT
opcode for the infect instruction |
static int |
LEFT
opcode for the left instruction |
static int |
RIGHT
opcode for the right instruction |
Constructor Summary | |
---|---|
Instruction(int opcode,
int address)
Creates a new instruction. |
Method Summary | |
---|---|
int |
getAddress()
Returns the addrss |
int |
getOpcode()
Returns the opcode |
String |
toString()
Returns a printable representation of an Instruction |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int HOP
public static final int LEFT
public static final int RIGHT
public static final int INFECT
public static final int IFEMPTY
public static final int IFWALL
public static final int IFSAME
public static final int IFENEMY
public static final int IFRANDOM
public static final int GO
Constructor Detail |
---|
public Instruction(int opcode, int address)
Method Detail |
---|
public int getOpcode()
public int getAddress()
public String toString()
toString
in class Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |