Module de.carne.mcd

Class InstructionReferenceEntry


  • public class InstructionReferenceEntry
    extends java.lang.Object
    Helper class representing a single entry/line in an instruction reference file.
    See Also:
    InstructionReference
    • 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)
    • Method Detail

      • 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:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(@Nullable java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object