@Deprecated public class WriterBackend extends Object implements Backend
Backend
which writes all output to a java.io.Writer.
The mark(Object o)
method does nothing in this implementation.
There is a method count()
which returns the number of characters
written by this so far.
This class is the cause for numerous unnecessary "throws IOException" clauses
throughout the entire project. It should be removed and replaced by StringBackend.
(Kai Wallisch 09/2014)Modifier and Type | Field and Description |
---|---|
protected int |
count
Deprecated.
|
protected int |
lineWidth
Deprecated.
|
protected Writer |
out
Deprecated.
|
Constructor and Description |
---|
WriterBackend(Writer w,
int lineWidth)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Deprecated.
Closes this backend
|
int |
count()
Deprecated.
Returns the number of characters written through this backend.
|
void |
flush()
Deprecated.
Flushes any buffered output
|
int |
lineWidth()
Deprecated.
Returns the available space per line
|
void |
mark(Object o)
Deprecated.
Gets called to record a
mark() call in the input. |
int |
measure(String s)
Deprecated.
Returns the space required to print the String
s |
void |
newLine()
Deprecated.
Start a new line.
|
void |
print(String s)
Deprecated.
Append a String
s to the output. |
protected Writer out
protected int lineWidth
protected int count
public WriterBackend(Writer w, int lineWidth)
public void print(String s) throws IOException
s
to the output. s
contains no newlines.print
in interface Backend
IOException
public void newLine() throws IOException
newLine
in interface Backend
IOException
public void close() throws IOException
close
in interface Backend
IOException
public void flush() throws IOException
flush
in interface Backend
IOException
public void mark(Object o)
mark()
call in the input.public int count()
public int lineWidth()