Class GeneratorState


  • public class GeneratorState
    extends java.lang.Object
    Track current state of the code generation. This class proxies a number of objects and can be extended for those objects as required.
    • Constructor Summary

      Constructors 
      Constructor Description
      GeneratorState​(int startAddress)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int currentAddress()
      This is the current address as defined by the start address + number of bytes generated.
      boolean hasMarkMoved()
      Indicates if a CodeMark has moved.
      java.io.ByteArrayOutputStream outputStream()
      Grab the ByteArrayOutputStream.
      void reset()
      Clear current state for another pass.
      void update​(CodeMark mark)
      Hook for the CodeMark to be updated and to capture if a change occurred.
      void write​(byte[] b)
      Write entire byte array to the output stream.
      void write​(int b)
      Write a byte to the output stream.
      • Methods inherited from class java.lang.Object

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

      • GeneratorState

        public GeneratorState​(int startAddress)
    • Method Detail

      • reset

        public void reset()
        Clear current state for another pass. Used while the generation is "settling down".
      • hasMarkMoved

        public boolean hasMarkMoved()
        Indicates if a CodeMark has moved.
      • update

        public void update​(CodeMark mark)
        Hook for the CodeMark to be updated and to capture if a change occurred.
      • outputStream

        public java.io.ByteArrayOutputStream outputStream()
        Grab the ByteArrayOutputStream. Only valid once generation is complete.
      • currentAddress

        public int currentAddress()
        This is the current address as defined by the start address + number of bytes generated.
      • write

        public void write​(int b)
        Write a byte to the output stream.
      • write

        public void write​(byte[] b)
                   throws java.io.IOException
        Write entire byte array to the output stream.
        Throws:
        java.io.IOException