- java.lang.Object
-
- de.carne.mcd.io.MCDPrintBuffer
-
-
Constructor Summary
Constructors Constructor Description MCDPrintBuffer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears this buffer instance.MCDPrintBufferdecreaseIndent()Decreases the indent level of all following print calls:MCDPrintBufferincreaseIndent()Increases the indent level of all following print calls:booleanisEmtpy()Checks whether this buffer instance is empty or not:MCDPrintBufferprint(java.lang.String text)Prints a standard text.MCDPrintBufferprintComment(java.lang.String comment)Prints a comment text.MCDPrintBufferprintError(java.lang.String error)Prints an error text.MCDPrintBufferprintKeyword(java.lang.String keyword)Prints a keyword text.MCDPrintBufferprintLabel(java.lang.String label)Prints a label text.MCDPrintBufferprintln()Prints a line break.MCDPrintBufferprintln(java.lang.String text)Prints a standard text and a line break.MCDPrintBufferprintlnComment(java.lang.String comment)Prints a comment text and a line break.MCDPrintBufferprintlnError(java.lang.String error)Prints an error text and a line break.MCDPrintBufferprintlnKeyword(java.lang.String keyword)Prints a keyword text and a line break.MCDPrintBufferprintlnLabel(java.lang.String label)Prints a label text and a line break.MCDPrintBufferprintlnOperator(java.lang.String operator)Prints an operator text and a line break.MCDPrintBufferprintlnValue(java.lang.String value)Prints a value text and a line break.MCDPrintBufferprintOperator(java.lang.String operator)Prints an operator text.voidprintTo(MCDOutput out)Prints this buffer instance's entries to the given MCDOutput.MCDPrintBufferprintValue(java.lang.String value)Prints a value text.java.lang.StringtoString()
-
-
-
Method Detail
-
isEmtpy
public boolean isEmtpy()
Checks whether this buffer instance is empty or not:- Returns:
trueif 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:MCDOutputIncreases the indent level of all following print calls:- Specified by:
increaseIndentin interfaceMCDOutput- 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:MCDOutputDecreases the indent level of all following print calls:- Specified by:
decreaseIndentin interfaceMCDOutput- 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:MCDOutputPrints a line break.
-
print
public MCDPrintBuffer print(java.lang.String text) throws java.io.IOException
Description copied from interface:MCDOutputPrints a standard text.
-
println
public MCDPrintBuffer println(java.lang.String text) throws java.io.IOException
Description copied from interface:MCDOutputPrints a standard text and a line break.
-
printValue
public MCDPrintBuffer printValue(java.lang.String value) throws java.io.IOException
Description copied from interface:MCDOutputPrints a value text.- Specified by:
printValuein interfaceMCDOutput- 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:MCDOutputPrints a value text and a line break.- Specified by:
printlnValuein interfaceMCDOutput- 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:MCDOutputPrints a comment text.- Specified by:
printCommentin interfaceMCDOutput- 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:MCDOutputPrints a comment text and a line break.- Specified by:
printlnCommentin interfaceMCDOutput- 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:MCDOutputPrints a keyword text.- Specified by:
printKeywordin interfaceMCDOutput- 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:MCDOutputPrints a keyword text and a line break.- Specified by:
printlnKeywordin interfaceMCDOutput- 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:MCDOutputPrints an operator text.- Specified by:
printOperatorin interfaceMCDOutput- 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:MCDOutputPrints an operator text and a line break.- Specified by:
printlnOperatorin interfaceMCDOutput- 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:MCDOutputPrints a label text.- Specified by:
printLabelin interfaceMCDOutput- 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:MCDOutputPrints a label text and a line break.- Specified by:
printlnLabelin interfaceMCDOutput- 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:MCDOutputPrints an error text.- Specified by:
printErrorin interfaceMCDOutput- 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:MCDOutputPrints an error text and a line break.- Specified by:
printlnErrorin interfaceMCDOutput- 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:
toStringin classjava.lang.Object
-
-