|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectde.uka.ilkd.pp.StringBackend
public class StringBackend
A Backend which appends all output to a StringBuffer.
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.
The method getString() gets the output written so far.
| Field Summary | |
|---|---|
protected int |
initOutLength
|
protected int |
lineWidth
|
protected java.lang.StringBuffer |
out
|
| Constructor Summary | |
|---|---|
StringBackend(int lineWidth)
Create a new StringBackend. |
|
StringBackend(java.lang.StringBuffer sb,
int lineWidth)
Create a new StringBackend. |
|
| Method Summary | |
|---|---|
void |
close()
Closes this backend |
int |
count()
Returns the number of characters written through this backend. |
void |
flush()
Flushes any buffered output |
java.lang.String |
getString()
Returns the accumulated output |
int |
lineWidth()
Returns the available space per line |
void |
mark(java.lang.Object o)
Gets called to record a mark() call in the input. |
int |
measure(java.lang.String s)
Returns the space required to print the String s |
void |
newLine()
Start a new line. |
void |
print(java.lang.String s)
Append a String s to the output. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.StringBuffer out
protected int initOutLength
protected int lineWidth
| Constructor Detail |
|---|
public StringBackend(java.lang.StringBuffer sb,
int lineWidth)
sb.
public StringBackend(int lineWidth)
| Method Detail |
|---|
public void print(java.lang.String s)
s to the output. s
contains no newlines.
print in interface Backend<NoExceptions>public void newLine()
newLine in interface Backend<NoExceptions>public void close()
close in interface Backend<NoExceptions>public void flush()
flush in interface Backend<NoExceptions>public void mark(java.lang.Object o)
mark() call in the input.
mark in interface Backend<NoExceptions>public int count()
public int lineWidth()
lineWidth in interface Backend<NoExceptions>public int measure(java.lang.String s)
s
measure in interface Backend<NoExceptions>public java.lang.String getString()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||