- java.lang.Object
-
- de.carne.mcd.io.MCDOutputBuffer
-
-
Constructor Summary
Constructors Constructor Description MCDOutputBuffer(MCDOutput out)Constructs a new MCDOutputBuffer instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcommit()Commits any buffered data operation.MCDOutputdecreaseIndent()Decreases the indent level of all following print calls:voiddiscard()Discard any buffered data operation.MCDOutputincreaseIndent()Increases the indent level of all following print calls:MCDOutputprint(java.lang.String text)Prints a standard text.MCDOutputprintComment(java.lang.String comment)Prints a comment text.MCDOutputprintError(java.lang.String error)Prints an error text.MCDOutputprintKeyword(java.lang.String keyword)Prints a keyword text.MCDOutputprintLabel(java.lang.String label)Prints a label text.MCDOutputprintln()Prints a line break.MCDOutputprintln(java.lang.String text)Prints a standard text and a line break.MCDOutputprintlnComment(java.lang.String comment)Prints a comment text and a line break.MCDOutputprintlnError(java.lang.String error)Prints an error text and a line break.MCDOutputprintlnKeyword(java.lang.String keyword)Prints a keyword text and a line break.MCDOutputprintlnLabel(java.lang.String label)Prints a label text and a line break.MCDOutputprintlnOperator(java.lang.String operator)Prints an operator text and a line break.MCDOutputprintlnValue(java.lang.String value)Prints a value text and a line break.MCDOutputprintOperator(java.lang.String operator)Prints an operator text.MCDOutputprintValue(java.lang.String value)Prints a value text.booleansetAutoCommit(boolean autoCommit)Sets the auto-commit flag for this MCDBuffer instance.java.lang.StringtoString()
-
-
-
Constructor Detail
-
MCDOutputBuffer
public MCDOutputBuffer(MCDOutput out)
Constructs a new MCDOutputBuffer instance.- Parameters:
out- the MCDOutput to emit the decoded data to.
-
-
Method Detail
-
setAutoCommit
public boolean setAutoCommit(boolean autoCommit)
Description copied from interface:MCDBufferSets the auto-commit flag for this MCDBuffer instance.- Specified by:
setAutoCommitin interfaceMCDBuffer- Parameters:
autoCommit- whether to auto-commit any buffer operation or not.- Returns:
- the previous auto-commit flag state.
-
discard
public void discard()
Description copied from interface:MCDBufferDiscard any buffered data operation.
-
commit
public void commit() throws java.io.IOExceptionDescription copied from interface:MCDBufferCommits any buffered data operation.
-
increaseIndent
public MCDOutput 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 MCDOutput 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 MCDOutput println() throws java.io.IOException
Description copied from interface:MCDOutputPrints a line break.
-
print
public MCDOutput print(java.lang.String text) throws java.io.IOException
Description copied from interface:MCDOutputPrints a standard text.
-
println
public MCDOutput println(java.lang.String text) throws java.io.IOException
Description copied from interface:MCDOutputPrints a standard text and a line break.
-
printValue
public MCDOutput 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 MCDOutput 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 MCDOutput 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 MCDOutput 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 MCDOutput 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 MCDOutput 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 MCDOutput 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 MCDOutput 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 MCDOutput 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 MCDOutput 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 MCDOutput 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 MCDOutput 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
-
-