|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmmp.engine.Output
public class Output
Output manages the diversions. The writer given to the constructor is
the standard output of the engine, registered as diversion '0'.
The built-in macro 'divert' can generate new diversions or redirect output
to already existing diversions.
Constructor Summary | |
---|---|
Output(java.io.Writer writer)
Initializes the output to the given writer. |
Method Summary | |
---|---|
void |
close()
Closes the output and flushes all diversions to the writer with divnum '0'. |
void |
divert(int divnum)
Sets the current writer to the string writer with diversion number 'divnum'. |
void |
exit()
Closes the output without flushing the diversions. |
int |
getCurrentDivnum()
Get the number of current diversion. |
void |
undivert()
Undiverts all diversions in numerical order into the current diversion. |
void |
undivert(int divnum)
Writes the content of diversion 'divnum' to the current writer and discards the diversion. |
void |
write(int c)
Write single char to current writer. |
void |
write(java.lang.String string)
Write string to current writer. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Output(java.io.Writer writer)
writer
- where to write outputMethod Detail |
---|
public final void close() throws java.io.IOException
java.io.IOException
- if io errorpublic final void divert(int divnum)
divnum
- number of writer to assign as the current writer.public final void exit() throws java.io.IOException
java.io.IOException
- if io errorpublic final int getCurrentDivnum()
public final void undivert() throws java.io.IOException
java.io.IOException
- if io errorpublic final void undivert(int divnum) throws java.io.IOException
divnum
- number of diversion to be output.
java.io.IOException
- if io errorpublic final void write(int c) throws java.io.IOException
c
- char to be written
java.io.IOException
- if io errorpublic final void write(java.lang.String string) throws java.io.IOException
string
- to be written to the current writer
java.io.IOException
- if io error
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |