gov.llnl.babel.backend.writers
Class LineCountingFilterWriter
java.lang.Object
java.io.Writer
java.io.FilterWriter
gov.llnl.babel.backend.writers.LineCountingFilterWriter
- All Implemented Interfaces:
- java.io.Closeable, java.io.Flushable, java.lang.Appendable
public class LineCountingFilterWriter
- extends java.io.FilterWriter
The LineCountingFilterWriter
keeps track of the current line going through the character
stream. If the write throws an exception, the line count
remains unchanged.
Fields inherited from class java.io.FilterWriter |
out |
Fields inherited from class java.io.Writer |
lock |
Methods inherited from class java.io.FilterWriter |
close, flush |
Methods inherited from class java.io.Writer |
append, append, append, append, append, append, write, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
d_line_count
protected int d_line_count
LineCountingFilterWriter
public LineCountingFilterWriter(java.io.Writer out)
getLineCount
public int getLineCount()
setLineCount
public void setLineCount(int i)
write
public void write(int c)
throws java.io.IOException
- Overrides:
write
in class java.io.FilterWriter
- Throws:
java.io.IOException
write
public void write(char[] cbuf,
int off,
int len)
throws java.io.IOException
- Overrides:
write
in class java.io.FilterWriter
- Throws:
java.io.IOException
write
public void write(java.lang.String str,
int off,
int len)
throws java.io.IOException
- Overrides:
write
in class java.io.FilterWriter
- Throws:
java.io.IOException
countLines
protected int countLines(char[] x,
int off,
int len)