Modifier and Type | Field and Description |
---|---|
static OpCode[] |
values
A static final (cached) copy of values()
|
Modifier and Type | Method and Description |
---|---|
int |
getCode()
Gets the 2-bit code for the opcode.
|
int |
getHeaderValue()
Gets the header int representation for this opcode.
|
static OpCode |
getOpCode(int code)
For a given 2-bit code, get the corresponding opcode.
|
static OpCode |
getOpCodeFromHeader(int header)
Takes a type 1 or type 2 header packet word and returns the
corresponding opcode.
|
static OpCode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static OpCode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final OpCode NOP
public static final OpCode READ
public static final OpCode WRITE
public static final OpCode RESERVED
public static final OpCode[] values
public static OpCode[] values()
for (OpCode c : OpCode.values()) System.out.println(c);
public static OpCode valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static OpCode getOpCodeFromHeader(int header)
header
- The packet header word (first word in a packet) of interest.public static OpCode getOpCode(int code)
code
- The 2-bit code of the opcode.public int getCode()
public int getHeaderValue()