|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ccg.macros.OutputStringBuffer
public class OutputStringBuffer
A Output implementation which uses a string buffer.
This implementation is fairly efficient and useful if you want to be able to get a String after interpreting macros.
Output| Constructor Summary | |
|---|---|
OutputStringBuffer()
Construct a output string buffer with the default initial capacity. |
|
OutputStringBuffer(int size)
Construct a output string buffer with a initial capacity. |
|
OutputStringBuffer(String init)
Construct a output buffer with some initial content. |
|
OutputStringBuffer(StringBuffer sb)
Construct a output buffer with a existing buffer. |
|
| Method Summary | |
|---|---|
void |
clear()
One line summary... |
StringBuffer |
getBuffer()
One line summary... |
void |
setBuffer(int size)
One line summary... |
void |
setBuffer(String with)
One line summary... |
void |
setBuffer(StringBuffer sb)
One line summary... |
String |
toString()
One line summary... |
void |
write(char[] buf,
int ofs,
int len)
Writes a set of characters from a buffer to the output. |
void |
write(Object o)
Appends the string representation of a Object to the output. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public OutputStringBuffer()
public OutputStringBuffer(int size)
cap - Initial capacity to allocate.public OutputStringBuffer(StringBuffer sb)
StringBuffer object. This will initialize the
resulting output with the contents of the object passed. All data
which is written to the output buffer will be
appended.
It should be noted, that in this case a new StringBuffer object is not allocated - the object will directly
append output to the object you supply.
init - Initial contents to load the output buffer with (any new
output will be appeneded). You can pass null (buffer won't
have any initial contents)setBuffer(StringBuffer)public OutputStringBuffer(String init)
String object. This will initialize the
resulting output with the contents of the object passed. All data
which is written to the output buffer will be
appended.
init - Initial contents to load the output buffer with (any new
output will be appended). You can pass null (buffer won't
have any initial contents)setBuffer(String)| Method Detail |
|---|
public void setBuffer(StringBuffer sb)
arg1 - arg1-describearg2 - arg2-describe
exc - Why thrownpublic void setBuffer(int size)
arg1 - arg1-describearg2 - arg2-describe
exc - Why thrownpublic void setBuffer(String with)
arg1 - arg1-describearg2 - arg2-describe
exc - Why thrownpublic StringBuffer getBuffer()
arg1 - arg1-describearg2 - arg2-describe
exc - Why thrownpublic void clear()
arg1 - arg1-describearg2 - arg2-describe
exc - Why thrownpublic String toString()
toString in class Objectarg1 - arg1-describearg2 - arg2-describe
exc - Why thrown
public void write(char[] buf,
int ofs,
int len)
throws IOException
AtMacros class) to send a set of characters to the
output device (string, file, etc).
write in interface Outputbuf - A character array to take the data from (must not be null)ofs - Offset into the buffer to the first character to start the
copy from. Should be in the range of [0,buf.length-1].len - How many characters to copy. When added to the offset, the
resulting value should not exceed the length of the array.
IOException - If a I/O error is encountered (which this implementation of a
Output device will probably never throw).
public void write(Object o)
throws IOException
string representation of a Object to the output.
This method is used by macro processors (such as the AtMacros class) to cause the string representation of a Object to be
added to the output produced.
write in interface Outputobject - The object to write out (the toString() method is used to write out the string
representation of the object). You may pass null (in which
case nothing will be done).
IOException - If a I/O error is encountered (which this implementation of a
Output device will probably never throw).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||