|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Output
Interface defining what to do with text generated from output.
As a "macro processor" is generating text output from the text
input it is processing, it will want a Output object
to store the output text to. This interface defines the methods
which such an output device must provide. Not exactly sure why I
didn't go with a standard Java Writer class for this
- however its easy enough to convert a standard Writer to a Output object.
The following classes implement this interface and can probably be used for most purposes:
OutputStringBufferOutputWriterWriter.
Interpreter,
OutputWriter,
OutputStringBuffer| Method Summary | |
|---|---|
void |
write(char[] buf,
int ofs,
int len)
Writes a set of characters from a buffer to the output. |
void |
write(Object o)
Outputs the string representation of a Object. |
| Method Detail |
|---|
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).
buf - 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.
void write(Object o)
throws IOException
string representation of a Object.
This method is used by macro processors (such as the AtMacros class) to cause the string representation of a Object to be
sent to the output device (string, file, etc).
object - 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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||