JHotDraw 7.4.1

org.jhotdraw.samples.teddy.io
Class LFWriter

java.lang.Object
  extended by java.io.Writer
      extended by java.io.FilterWriter
          extended by org.jhotdraw.samples.teddy.io.LFWriter
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.Appendable

public class LFWriter
extends java.io.FilterWriter

A 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.

Version:
$Id: LFWriter.java 527 2009-06-07 14:28:19Z rawcoder $
Author:
Werner Randelshofer

Field Summary
 
Fields inherited from class java.io.FilterWriter
out
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
LFWriter(java.io.Writer out)
          Create a new line-numbering writer.
 
Method Summary
 java.lang.String getLineSeparator()
          Gets the line separator of the println() methods.
 void setLineSeparator(java.lang.String lineSeparator)
          Sets the line separator for the println() methods.
 void write(char[] cbuf, int off, int len)
          Write a portion of an array of characters.
 void write(int c)
          Write a single character.
 void write(java.lang.String str, int off, int len)
          Write a portion of a string.
 
Methods inherited from class java.io.FilterWriter
close, flush
 
Methods inherited from class java.io.Writer
append, append, append, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LFWriter

public LFWriter(java.io.Writer out)
Create a new line-numbering writer.

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.IOException
Write a single character.

Overrides:
write in class java.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.IOException
Write a portion of an array of characters.

Overrides:
write in class java.io.FilterWriter
Parameters:
cbuf - Buffer of characters to be written
off - Offset from which to start reading characters
len - 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.IOException
Write a portion of a string.

Overrides:
write in class java.io.FilterWriter
Parameters:
str - String to be written
off - Offset from which to start reading characters
len - Number of characters to be written
Throws:
java.io.IOException - If an I/O error occurs

Copyright 1996-2010 (c) by the authors and contributors of the JHotDraw project.
Some rights reserved.