- java.lang.Object
-
- de.carne.mcd.bootstrap.InstructionReferenceEntry
-
public class InstructionReferenceEntry extends java.lang.ObjectHelper class representing a single entry/line in an instruction reference file.- See Also:
InstructionReference
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringNO_VALUE"No value" field
-
Constructor Summary
Constructors Modifier Constructor Description protectedInstructionReferenceEntry(InstructionReferenceEntry entryData)protectedInstructionReferenceEntry(InstructionOpcode opcode, java.lang.String mnemonic, java.util.List<java.lang.String> extraFields)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddExtraFields(java.util.List<java.lang.String> additionalExtraFields)Adds an additional number of extra fields to this entry.booleanequals(@Nullable java.lang.Object obj)java.util.List<java.lang.String>extraFields()Gets the mnemonic associated with this entry's opcode.java.lang.StringgetExtraField(int index)Gets the value of a specific extra field.inthashCode()java.lang.Stringmnemonic()Gets the mnemonic associated with this entry's opcode.InstructionOpcodeopcode()Gets the InstructionOpcode this entry defines.voidsetExtraField(int index, java.lang.String value)Sets the value of a specific extra field.InstructiontoInstruction()Converts this entry to the corresponding Instruction instance.java.lang.StringtoString()
-
-
-
Field Detail
-
NO_VALUE
public static final java.lang.String NO_VALUE
"No value" field- See Also:
- Constant Field Values
-
-
Constructor Detail
-
InstructionReferenceEntry
protected InstructionReferenceEntry(InstructionOpcode opcode, java.lang.String mnemonic, java.util.List<java.lang.String> extraFields)
-
InstructionReferenceEntry
protected InstructionReferenceEntry(InstructionReferenceEntry entryData)
-
-
Method Detail
-
opcode
public InstructionOpcode opcode()
Gets the InstructionOpcode this entry defines.- Returns:
- the InstructionOpcode this entry defines.
-
mnemonic
public java.lang.String mnemonic()
Gets the mnemonic associated with this entry's opcode.- Returns:
- the mnemonic associated with this entry's opcode.
-
extraFields
public java.util.List<java.lang.String> extraFields()
Gets the mnemonic associated with this entry's opcode.- Returns:
- the mnemonic associated with this entry's opcode.
-
getExtraField
public java.lang.String getExtraField(int index)
Gets the value of a specific extra field.- Parameters:
index- the index of the extra field to get.- Returns:
- the extra field value.
-
setExtraField
public void setExtraField(int index, java.lang.String value)Sets the value of a specific extra field.- Parameters:
index- the index of the extra field to set.value- the value to set.
-
addExtraFields
public void addExtraFields(java.util.List<java.lang.String> additionalExtraFields)
Adds an additional number of extra fields to this entry.- Parameters:
additionalExtraFields- the additional extra fields to add.
-
toInstruction
public Instruction toInstruction() throws java.io.IOException
Converts this entry to the corresponding Instruction instance.- Returns:
- the Instruction instance represented by this entry.
- Throws:
java.io.IOException- if the conversion fails.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(@Nullable java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-