gov.llnl.babel.backend.writers

Class LineCountingFilterWriter


public class LineCountingFilterWriter
extends 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.

Field Summary

protected int
d_line_count

Constructor Summary

LineCountingFilterWriter(java.io.Writer out)

Method Summary

protected int
countLines(char[] x, int off, int len)
int
getLineCount()
void
setLineCount(int i)
void
write(String str, int off, int len)
void
write(char[] cbuf, int off, int len)
void
write(int c)

Field Details

d_line_count

protected int d_line_count

Constructor Details

LineCountingFilterWriter

public LineCountingFilterWriter(java.io.Writer out)

Method Details

countLines

protected int countLines(char[] x,
                         int off,
                         int len)

getLineCount

public int getLineCount()

setLineCount

public void setLineCount(int i)

write

public void write(String str,
                  int off,
                  int len)
            throws IOException

write

public void write(char[] cbuf,
                  int off,
                  int len)
            throws IOException

write

public void write(int c)
            throws IOException