com.ccg.macros
Interface Output

All Known Implementing Classes:
OutputNull, OutputStringBuffer, OutputWriter

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:

OutputStringBuffer
Used when one would like the results of the macro processing stored to a string. Also handy for the creation of macro processing classes for recursive processing.
OutputWriter
Used for creating output to a standard Writer.

Since:
1.0
Version:
$Revision: 1.1.1.1 $
Author:
$Author: pkb $
See Also:
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

write

void write(char[] buf,
           int ofs,
           int len)
           throws IOException
Writes a set of characters from a buffer to the output. This method is used by macro processors (such as the AtMacros class) to send a set of characters to the output device (string, file, etc).

Parameters:
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.
Throws:
IOException - If a I/O error is encountered.
Since:
1.0

write

void write(Object o)
           throws IOException
Outputs the 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).

Parameters:
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).
Throws:
IOException - If a I/O error is encountered.
Since:
1.0


Copyright 1998-1998-2006 null. All Rights Reserved.