org.geotoolkit.io
Class NumberedLineWriter
Object
Writer
FilterWriter
IndentedLineWriter
NumberedLineWriter
- All Implemented Interfaces:
- Closeable, Flushable, Appendable
@ThreadSafe
@Decorator(value=java.io.Writer.class)
public class NumberedLineWriter
- extends IndentedLineWriter
A writer that put line number in front of every line.
- Since:
- 2.1
- Version:
- 3.00
- Author:
- Martin Desruisseaux (IRD, Geomatys)
- Module:
|
Constructor Summary |
NumberedLineWriter(Writer out)
Constructs a stream which will write line number in front of each line. |
NumberedLineWriter
public NumberedLineWriter(Writer out)
- Constructs a stream which will write line number in front of each line.
- Parameters:
out - The underlying stream to write to.
getStandardOutput
public static PrintWriter getStandardOutput()
- Returns a default numbered line writer to the standard output stream.
The
FilterWriter.close() method on this stream will only flush it without closing it.
- Returns:
- A unique numbered line writer to the standard output stream.
getLineNumber
public int getLineNumber()
- Returns the current line number.
- Returns:
- The current line number.
setLineNumber
public void setLineNumber(int line)
- Sets the current line number.
- Parameters:
line - The current line number.
beginNewLine
protected void beginNewLine()
throws IOException
- Invoked when a new line is beginning. The default implementation writes the
current line number.
- Overrides:
beginNewLine in class IndentedLineWriter
- Throws:
IOException - If an I/O error occurs
toString
public String toString()
- Returns a string representation if this writer.
- Overrides:
toString in class Object
Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.