|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectumontreal.iro.lecuyer.util.LineBreaker
public class LineBreaker
Provides facilities to write multiple lines into output streams or writers, with automatic conversion of line separators. Strings are often generated using a string builder Strings are often generated by string builders before they are written into streams (e.g., files or console). When the generated strings contain multiple lines, the newline character (n) is often used as a line separator, but this does not always correspond to the platform's end-of-line separator. This class can be used to convert the line separators to the appropriate- platform-dependent, line separator before writing strings into streams.
Method Summary | ||
---|---|---|
static String |
getDefaultLineSeparator()
Returns the default, platform-dependent, line separator. |
|
static void |
writeLines(BufferedWriter out,
String str)
Similar to String) , for a buffered
writer. |
|
static void |
writeLines(PrintStream out,
String str)
Similar to String) , for a print stream. |
|
static void |
writeLines(PrintWriter out,
String str)
Prints the string out using the correct platform-specific line separator. |
|
static
|
writeLines(T out,
String str,
String lineSeparator)
Similar to String) , for a generic
appendable object, and a user-defined line separator
lineSeparator. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void writeLines(PrintWriter out, String str)
PrintWriter.println(String)
for each part.
out
- the print writer.str
- the string to write.public static void writeLines(PrintStream out, String str)
String)
, for a print stream.
out
- the print stream.str
- the string.public static void writeLines(BufferedWriter out, String str) throws IOException
String)
, for a buffered
writer.
out
- the buffered writer.str
- the string.
if
- an I/O error occurs.
IOException
public static <T extends Appendable> T writeLines(T out, String str, String lineSeparator) throws IOException
String)
, for a generic
appendable object, and a user-defined line separator
lineSeparator.
out
- the buffered writer.str
- the string.lineSeparator
- the line separator.
if
- an I/O error occurs.
IOException
public static String getDefaultLineSeparator()
|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |