Module de.carne.mcd

Class InstructionReference<T extends InstructionReferenceEntry>

  • Type Parameters:
    T - the actual instruction reference entry type.

    public abstract class InstructionReference<T extends InstructionReferenceEntry>
    extends java.lang.Object
    Helper class used to create and update a instruction reference file suitable for InstructionIndex generation.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void addOrUpdateEntries​(java.lang.Iterable<T> entries)
      Adds or updates a collection of instruction reference entries.
      void addOrUpdateEntry​(T entry)
      Adds or updates an instruction reference entry.
      InstructionIndexBuilder build​(InstructionIndexBuilder builder)
      Builds up the instruction index by feeding all reference entries into the given InstructionIndexBuilder instance.
      void load​(java.io.File file)
      Loads instruction reference entries from a file.
      void load​(java.io.File file, java.nio.charset.Charset cs)
      Loads instruction reference entries from a file.
      void logStatus()
      Logs the current status of this instance.
      protected T mergeEntries​(T left, T right)  
      protected abstract T newEntry​(InstructionReferenceEntry entryData)  
      void save​(java.io.File file)
      Saves all instruction reference entries to a file.
      void save​(java.io.File file, java.nio.charset.Charset cs)
      Saves all instruction reference entries to a file.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • InstructionReference

        public InstructionReference()
    • Method Detail

      • load

        public void load​(java.io.File file)
                  throws java.io.IOException
        Loads instruction reference entries from a file.
        Parameters:
        file - the file to load from.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • load

        public void load​(java.io.File file,
                         java.nio.charset.Charset cs)
                  throws java.io.IOException
        Loads instruction reference entries from a file.
        Parameters:
        file - the file to load from.
        cs - the Charset to use for text conversion.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • newEntry

        protected abstract T newEntry​(InstructionReferenceEntry entryData)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • addOrUpdateEntries

        public void addOrUpdateEntries​(java.lang.Iterable<T> entries)
                                throws java.io.IOException
        Adds or updates a collection of instruction reference entries.
        Parameters:
        entries - the entries to add or update.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • addOrUpdateEntry

        public void addOrUpdateEntry​(T entry)
                              throws java.io.IOException
        Adds or updates an instruction reference entry.
        Parameters:
        entry - the entry to add or update.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • mergeEntries

        protected T mergeEntries​(T left,
                                 T right)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • save

        public void save​(java.io.File file)
                  throws java.io.IOException
        Saves all instruction reference entries to a file.
        Parameters:
        file - the file to save to.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • save

        public void save​(java.io.File file,
                         java.nio.charset.Charset cs)
                  throws java.io.IOException
        Saves all instruction reference entries to a file.
        Parameters:
        file - the file to save to.
        cs - the Charset to use for text conversion.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • logStatus

        public void logStatus()
        Logs the current status of this instance.