|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Print values as a comma separated list. More information about this class is available from ostermiller.org. This interface is designed to be set of general methods that all CSV printers should implement.
Method Summary | |
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. |
Method Detail |
public void changeDelimiter(char newDelimiter) throws BadDelimeterException
newDelimiter
- The new delimiter character to use.
BadDelimiterException
- if the character cannot be used as a delimiter.
BadDelimeterException
public void changeQuote(char newQuote) throws BadQuoteException
newQuote
- The new character to use for quoting.
BadQuoteException
- if the character cannot be used as a quote.public void setAutoFlush(boolean autoFlush)
autoFlush
- should auto flushing be enabled.public boolean checkError()
public 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.public void writeln(java.lang.String value) throws java.io.IOException
value
- value to be outputted.
java.io.IOException
- if an error occurs while writing.public 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.
public void writeln() throws java.io.IOException
java.io.IOException
- if an error occurs while writing.public 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.public void writeln(java.lang.String[] values) throws java.io.IOException
values
- values to be outputted.
java.io.IOException
- if an error occurs while writing.public 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.public void writeln(java.lang.String[][] values) throws java.io.IOException
values
- values to be outputted.
java.io.IOException
- if an error occurs while writing.public 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.public void writelnComment(java.lang.String comment) throws java.io.IOException
comment
- the comment to output.
java.io.IOException
- if an error occurs while writing.public 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.public void write(java.lang.String value) throws java.io.IOException
value
- value to be outputted.
java.io.IOException
- if an error occurs while writing.public void flush() throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
java.io.IOException
public void 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.public void write(java.lang.String[] values) throws java.io.IOException
values
- values to be outputted.
java.io.IOException
- if an error occurs while writing.public void setAlwaysQuote(boolean alwaysQuote)
alwaysQuote
- true if quotes should be used even when not strictly needed.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |