public interface CSVPrint
| Modifier and Type | Method and Description |
|---|---|
void |
changeDelimiter(char newDelimiter)
Change this printer so that it uses a new delimiter.
|
void |
changeQuote(char newQuote)
Change this printer so that it uses a new character for quoting.
|
boolean |
checkError()
Flush the stream if it's not closed and check its error state.
|
void |
close()
Close any underlying streams.
|
void |
flush()
Flush any data written out to underlying streams.
|
void |
print(java.lang.String value)
Print the string as the next value on the line.
|
void |
print(java.lang.String[] values)
Print multiple delimited values values.
|
void |
println()
Output a blank line.
|
void |
println(java.lang.String value)
Print the string as the last value on the line.
|
void |
println(java.lang.String[] values)
Print a single line of comma separated values.
|
void |
println(java.lang.String[][] values)
Print several lines of comma separated values.
|
void |
printlnComment(java.lang.String comment)
If the CSV format supports comments, write the comment
to the file on its own line, otherwise, start a new line.
|
void |
setAlwaysQuote(boolean alwaysQuote)
Set whether values printers should always be quoted, or
whether the printer may, at its discretion, omit quotes
around the value.
|
void |
setAutoFlush(boolean autoFlush)
Set flushing behavior.
|
void |
write(java.lang.String value)
Print the string as the next value on the line.
|
void |
write(java.lang.String[] values)
Print multiple delimited values values.
|
void |
writeln()
Output a blank line.
|
void |
writeln(java.lang.String value)
Print the string as the last value on the line.
|
void |
writeln(java.lang.String[] values)
Print a single line of comma separated values.
|
void |
writeln(java.lang.String[][] values)
Print several lines of comma separated values.
|
void |
writelnComment(java.lang.String comment)
If the CSV format supports comments, write the comment
to the file on its own line, otherwise, start a new line.
|
void changeDelimiter(char newDelimiter)
throws BadDelimiterException
newDelimiter - The new delimiter character to use.BadDelimiterException - if the character cannot be used as a delimiter.void changeQuote(char newQuote)
throws BadQuoteException
newQuote - The new character to use for quoting.BadQuoteException - if the character cannot be used as a quote.void setAutoFlush(boolean autoFlush)
autoFlush - should auto flushing be enabled.boolean checkError()
void println(java.lang.String value)
This method never throws an I/O exception. The client may inquire as to whether any errors have occurred by invoking checkError(). If an I/O Exception is desired, the client should use the corresponding writeln method.
value - value to be outputted.void writeln(java.lang.String value)
throws java.io.IOException
value - value to be outputted.java.io.IOException - if an error occurs while writing.void println()
This method never throws an I/O exception. The client may inquire as to whether any errors have occurred by invoking checkError(). If an I/O Exception is desired, the client should use the corresponding writeln method.
void writeln()
throws java.io.IOException
java.io.IOException - if an error occurs while writing.void println(java.lang.String[] values)
This method never throws an I/O exception. The client may inquire as to whether any errors have occurred by invoking checkError(). If an I/O Exception is desired, the client should use the corresponding writeln method.
values - values to be outputted.void writeln(java.lang.String[] values)
throws java.io.IOException
values - values to be outputted.java.io.IOException - if an error occurs while writing.void println(java.lang.String[][] values)
This method never throws an I/O exception. The client may inquire as to whether any errors have occurred by invoking checkError(). If an I/O Exception is desired, the client should use the corresponding writeln method.
values - values to be outputted.void writeln(java.lang.String[][] values)
throws java.io.IOException
values - values to be outputted.java.io.IOException - if an error occurs while writing.void printlnComment(java.lang.String comment)
This method never throws an I/O exception. The client may inquire as to whether any errors have occurred by invoking checkError(). If an I/O Exception is desired, the client should use the corresponding writelnComment method.
comment - the comment to output.void writelnComment(java.lang.String comment)
throws java.io.IOException
comment - the comment to output.java.io.IOException - if an error occurs while writing.void print(java.lang.String value)
This method never throws an I/O exception. The client may inquire as to whether any errors have occurred by invoking checkError(). If an I/O Exception is desired, the client should use the corresponding println method.
value - value to be outputted.void write(java.lang.String value)
throws java.io.IOException
value - value to be outputted.java.io.IOException - if an error occurs while writing.void flush()
throws java.io.IOException
java.io.IOException - if an IO error occursvoid close()
throws java.io.IOException
java.io.IOException - if an IO error occursvoid print(java.lang.String[] values)
This method never throws an I/O exception. The client may inquire as to whether any errors have occurred by invoking checkError(). If an I/O Exception is desired, the client should use the corresponding write method.
values - values to be outputted.void write(java.lang.String[] values)
throws java.io.IOException
values - values to be outputted.java.io.IOException - if an error occurs while writing.void setAlwaysQuote(boolean alwaysQuote)
alwaysQuote - true if quotes should be used even when not strictly needed.Copyright (c) 2001-2020 by Stephen Ostermiller