|
com.Ostermiller.util Java Utilities |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CSVPrint
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(String value)
Print the string as the next value on the line. |
void |
print(String[] values)
Print multiple delimited values values. |
void |
println()
Output a blank line. |
void |
println(String value)
Print the string as the last value on the line. |
void |
println(String[] values)
Print a single line of comma separated values. |
void |
println(String[][] values)
Print several lines of comma separated values. |
void |
printlnComment(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(String value)
Print the string as the next value on the line. |
void |
write(String[] values)
Print multiple delimited values values. |
void |
writeln()
Output a blank line. |
void |
writeln(String value)
Print the string as the last value on the line. |
void |
writeln(String[] values)
Print a single line of comma separated values. |
void |
writeln(String[][] values)
Print several lines of comma separated values. |
void |
writelnComment(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 |
---|
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(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(String value) throws IOException
value
- value to be outputted.
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 IOException
IOException
- if an error occurs while writing.void println(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(String[] values) throws IOException
values
- values to be outputted.
IOException
- if an error occurs while writing.void println(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(String[][] values) throws IOException
values
- values to be outputted.
IOException
- if an error occurs while writing.void printlnComment(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(String comment) throws IOException
comment
- the comment to output.
IOException
- if an error occurs while writing.void print(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(String value) throws IOException
value
- value to be outputted.
IOException
- if an error occurs while writing.void flush() throws IOException
IOException
- if an IO error occursvoid close() throws IOException
IOException
- if an IO error occursvoid print(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(String[] values) throws IOException
values
- values to be outputted.
IOException
- if an error occurs while writing.void setAlwaysQuote(boolean alwaysQuote)
alwaysQuote
- true if quotes should be used even when not strictly needed.
|
com.Ostermiller.util Java Utilities |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2001-2012 by Stephen Ostermiller