public class DecodedInstruction extends Object
| Constructor and Description |
|---|
DecodedInstruction() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int key,
byte[] bits)
Adds the recognized subrule-returning variant to the instruction.
|
void |
add(int key,
String string,
int constant)
Adds the recognized string-returning variant to the instruction.
|
int |
get(int key)
Returns the constant value to which the given key is mapped.
|
byte[] |
getBits(int key)
Returns the bit sequence to which the given key is mapped.
|
byte[] |
getBits(int key,
boolean reverseBytes)
Returns the bit sequence to which the given key is mapped.
|
byte[] |
getImage()
Returns the binary image of the whole instruction.
|
Set<Integer> |
getKeys()
Returns the set of all keys contained in this instruction.
|
int |
getLength()
Returns the length of the instruction in the memory.
|
String |
getString(int key)
Returns the string value to which the given key is mapped.
|
boolean |
hasKey(int key)
Returns true if the instruction contains the specified key.
|
void |
setImage(byte[] image)
Sets the binary image of the whole instruction.
|
public void add(int key,
String string,
int constant)
key - the key (rule code)string - the string which the recognized variant returnedconstant - the constant obtained from the stringpublic void add(int key,
byte[] bits)
key - the rule codebits - the bit sequence, padded to whole bytespublic boolean hasKey(int key)
key - the rule codepublic int get(int key)
key - the keypublic String getString(int key)
key - the keypublic byte[] getBits(int key)
key - the keypublic byte[] getBits(int key,
boolean reverseBytes)
key - the keyreverseBytes - reverse the byte order - this is useful to convert
the data from Little to Big Endian (Java uses Big Endian)public byte[] getImage()
public void setImage(byte[] image)
image - the binary imagepublic int getLength()
Copyright © 2017. All rights reserved.