org.jhotdraw.samples.teddy.io
Class LFWriter
- java.lang.Object
-
- java.io.Writer
-
- java.io.FilterWriter
-
- org.jhotdraw.samples.teddy.io.LFWriter
-
- All Implemented Interfaces:
- java.io.Closeable, java.io.Flushable, java.lang.Appendable, java.lang.AutoCloseable
public class LFWriter extends java.io.FilterWriterA character-output stream that converts line terminators into a configurable line separator sequence. A line is considered to be terminated by any one of a line feed ('\n'), a carriage return ('\r'), or a carriage return followed immediately by a linefeed.
-
-
Constructor Summary
Constructors Constructor and Description LFWriter(java.io.Writer out)Create a new line-numbering writer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.StringgetLineSeparator()Gets the line separator of the println() methods.voidsetLineSeparator(java.lang.String lineSeparator)Sets the line separator for the println() methods.voidwrite(char[] cbuf, int off, int len)Write a portion of an array of characters.voidwrite(int c)Write a single character.voidwrite(java.lang.String str, int off, int len)Write a portion of a string.
-
-
-
Method Detail
-
getLineSeparator
public java.lang.String getLineSeparator()
Gets the line separator of the println() methods.
-
setLineSeparator
public void setLineSeparator(java.lang.String lineSeparator)
Sets the line separator for the println() methods.
-
write
public void write(int c) throws java.io.IOExceptionWrite a single character.- Overrides:
writein classjava.io.FilterWriter- Throws:
java.io.IOException- If an I/O error occurs
-
write
public void write(char[] cbuf, int off, int len) throws java.io.IOExceptionWrite a portion of an array of characters.- Overrides:
writein classjava.io.FilterWriter- Parameters:
cbuf- Buffer of characters to be writtenoff- Offset from which to start reading characterslen- Number of characters to be written- Throws:
java.io.IOException- If an I/O error occurs
-
write
public void write(java.lang.String str, int off, int len) throws java.io.IOExceptionWrite a portion of a string.- Overrides:
writein classjava.io.FilterWriter- Parameters:
str- String to be writtenoff- Offset from which to start reading characterslen- Number of characters to be written- Throws:
java.io.IOException- If an I/O error occurs
-
-
DataMelt 3.0 © DataMelt by jWork.ORG