Module de.carne.mcd

Class MCDPrintBuffer

  • All Implemented Interfaces:
    MCDOutput

    public final class MCDPrintBuffer
    extends java.lang.Object
    implements MCDOutput
    Utility class used for queuing MCDOutput commands.
    • Constructor Detail

      • MCDPrintBuffer

        public MCDPrintBuffer()
    • Method Detail

      • isEmtpy

        public boolean isEmtpy()
        Checks whether this buffer instance is empty or not:
        Returns:
        true if this buffer instance is empty (generates no output).
      • clear

        public void clear()
        Clears this buffer instance.
      • printTo

        public void printTo​(MCDOutput out)
                     throws java.io.IOException
        Prints this buffer instance's entries to the given MCDOutput.
        Parameters:
        out - the MCDOutput to print to.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • increaseIndent

        public MCDPrintBuffer increaseIndent()
                                      throws java.io.IOException
        Description copied from interface: MCDOutput
        Increases the indent level of all following print calls:
        Specified by:
        increaseIndent in interface MCDOutput
        Returns:
        this instance for chaining.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • decreaseIndent

        public MCDPrintBuffer decreaseIndent()
                                      throws java.io.IOException
        Description copied from interface: MCDOutput
        Decreases the indent level of all following print calls:
        Specified by:
        decreaseIndent in interface MCDOutput
        Returns:
        this instance for chaining.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • println

        public MCDPrintBuffer println()
                               throws java.io.IOException
        Description copied from interface: MCDOutput
        Prints a line break.
        Specified by:
        println in interface MCDOutput
        Returns:
        this instance for chaining.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • print

        public MCDPrintBuffer print​(java.lang.String text)
                             throws java.io.IOException
        Description copied from interface: MCDOutput
        Prints a standard text.
        Specified by:
        print in interface MCDOutput
        Parameters:
        text - the text to print.
        Returns:
        this instance for chaining.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • println

        public MCDPrintBuffer println​(java.lang.String text)
                               throws java.io.IOException
        Description copied from interface: MCDOutput
        Prints a standard text and a line break.
        Specified by:
        println in interface MCDOutput
        Parameters:
        text - the text to print.
        Returns:
        this instance for chaining.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • printValue

        public MCDPrintBuffer printValue​(java.lang.String value)
                                  throws java.io.IOException
        Description copied from interface: MCDOutput
        Prints a value text.
        Specified by:
        printValue in interface MCDOutput
        Parameters:
        value - the text to print.
        Returns:
        this instance for chaining.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • printlnValue

        public MCDPrintBuffer printlnValue​(java.lang.String value)
                                    throws java.io.IOException
        Description copied from interface: MCDOutput
        Prints a value text and a line break.
        Specified by:
        printlnValue in interface MCDOutput
        Parameters:
        value - the text to print.
        Returns:
        this instance for chaining.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • printComment

        public MCDPrintBuffer printComment​(java.lang.String comment)
                                    throws java.io.IOException
        Description copied from interface: MCDOutput
        Prints a comment text.
        Specified by:
        printComment in interface MCDOutput
        Parameters:
        comment - the text to print.
        Returns:
        this instance for chaining.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • printlnComment

        public MCDPrintBuffer printlnComment​(java.lang.String comment)
                                      throws java.io.IOException
        Description copied from interface: MCDOutput
        Prints a comment text and a line break.
        Specified by:
        printlnComment in interface MCDOutput
        Parameters:
        comment - the text to print.
        Returns:
        this instance for chaining.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • printKeyword

        public MCDPrintBuffer printKeyword​(java.lang.String keyword)
                                    throws java.io.IOException
        Description copied from interface: MCDOutput
        Prints a keyword text.
        Specified by:
        printKeyword in interface MCDOutput
        Parameters:
        keyword - the text to print.
        Returns:
        this instance for chaining.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • printlnKeyword

        public MCDPrintBuffer printlnKeyword​(java.lang.String keyword)
                                      throws java.io.IOException
        Description copied from interface: MCDOutput
        Prints a keyword text and a line break.
        Specified by:
        printlnKeyword in interface MCDOutput
        Parameters:
        keyword - the text to print.
        Returns:
        this instance for chaining.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • printOperator

        public MCDPrintBuffer printOperator​(java.lang.String operator)
                                     throws java.io.IOException
        Description copied from interface: MCDOutput
        Prints an operator text.
        Specified by:
        printOperator in interface MCDOutput
        Parameters:
        operator - the text to print.
        Returns:
        this instance for chaining.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • printlnOperator

        public MCDPrintBuffer printlnOperator​(java.lang.String operator)
                                       throws java.io.IOException
        Description copied from interface: MCDOutput
        Prints an operator text and a line break.
        Specified by:
        printlnOperator in interface MCDOutput
        Parameters:
        operator - the text to print.
        Returns:
        this instance for chaining.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • printLabel

        public MCDPrintBuffer printLabel​(java.lang.String label)
                                  throws java.io.IOException
        Description copied from interface: MCDOutput
        Prints a label text.
        Specified by:
        printLabel in interface MCDOutput
        Parameters:
        label - the text to print.
        Returns:
        this instance for chaining.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • printlnLabel

        public MCDPrintBuffer printlnLabel​(java.lang.String label)
                                    throws java.io.IOException
        Description copied from interface: MCDOutput
        Prints a label text and a line break.
        Specified by:
        printlnLabel in interface MCDOutput
        Parameters:
        label - the text to print.
        Returns:
        this instance for chaining.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • printError

        public MCDPrintBuffer printError​(java.lang.String error)
                                  throws java.io.IOException
        Description copied from interface: MCDOutput
        Prints an error text.
        Specified by:
        printError in interface MCDOutput
        Parameters:
        error - the text to print.
        Returns:
        this instance for chaining.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • printlnError

        public MCDPrintBuffer printlnError​(java.lang.String error)
                                    throws java.io.IOException
        Description copied from interface: MCDOutput
        Prints an error text and a line break.
        Specified by:
        printlnError in interface MCDOutput
        Parameters:
        error - the text to print.
        Returns:
        this instance for chaining.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • toString

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