org.geotools.io
Class NumberedLineWriter
Object
Writer
FilterWriter
IndentedLineWriter
NumberedLineWriter
- All Implemented Interfaces:
- Closeable, Flushable, Appendable
public class NumberedLineWriter
- extends IndentedLineWriter
A writer that put line number in front of every line.
- Since:
- 2.1
- Author:
- Martin Desruisseaux (IRD)
- Module:
Constructor Summary |
NumberedLineWriter(Writer out)
Constructs a stream which will write line number in front of each line. |
Method Summary |
protected void |
beginNewLine()
Invoked when a new line is begining. |
int |
getLineNumber()
Returns the current line number. |
void |
setLineNumber(int line)
Sets the current line number. |
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OUT
public static final PrintWriter OUT
- A default numbered line writer to the standard output stream.
The
FilterWriter.close()
method on this stream will only flush it without closing it.
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.
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 begining. The default implementation writes the
current line number.
- Overrides:
beginNewLine
in class IndentedLineWriter
- Throws:
IOException
- If an I/O error occurs
Copyright © 1996-2009 Geotools. All Rights Reserved.