| Overview | Package | Class | Tree | Deprecated | Index | Help | |||
| PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||
java.lang.Object
|
+--java.io.Writer
|
+--java.io.PrintWriter
|
+--ncsa.horizon.util.MultiPrintWriter
This class provides a single target for messages that are to go to multiple output streams. For example, one might want error messages to go to both the terminal screen and a log file. By default, no streams are attached so messages sent to this writer are just thrown away. Thus, this allows one to dynamically add and remove receiving streams without changing the code that actually writes the messages.
| Field Summary | |
| MultiPrintWriter | last
|
| java.io.PrintWriter | mine
|
| java.lang.String | name
|
| MultiPrintWriter | next
|
| Fields inherited from class java.io.PrintWriter | |
| out | |
| Fields inherited from class java.io.Writer | |
| lock | |
| Constructor Summary | |
| MultiPrintWriter()
create an empty chain of writers |
|
| MultiPrintWriter(java.io.Writer wr)
initialize a chain of writers with a given Writer |
|
| MultiPrintWriter(java.io.Writer wr,
boolean autoflush)
initialize a chain of writers with a given PrintWriter |
|
| MultiPrintWriter(java.io.PrintWriter wr)
initialize a chain of writers with a given PrintWriter |
|
| MultiPrintWriter(java.io.PrintWriter wr,
boolean autoflush)
initialize a chain of writers with a given Writer |
|
| MultiPrintWriter(java.io.OutputStream os)
initialize a chain of writers with a given OutputStream |
|
| MultiPrintWriter(java.io.OutputStream os,
boolean autoflush)
initialize a chain of writers with a given OutputStream |
|
| Method Summary | |
| void | addOutput(java.io.Writer wr,
boolean autoFlush)
add a new Writer to this chain |
| void | addOutput(java.io.Writer wr)
add a new Writer to this chain |
| void | addOutput(java.io.OutputStream os,
boolean autoFlush)
add a new Writer to this chain |
| void | addOutput(java.io.OutputStream os)
add a new Writer to this chain |
| void | addOutput(java.io.PrintWriter wr)
add a PrintWriter to this chain |
| boolean | checkError()
Flush the streams and check their error states. |
| void | close()
close the stream; this implementation ignores this request |
| boolean | contains(java.io.PrintWriter pw)
return true if a given PrintWriter is in this chain |
| boolean | contains(java.io.Writer pw)
return true if a given Writer is in this chain |
| boolean | contains(java.io.OutputStream pw)
return true if a given OutputStream is in this chain |
| void | flush()
flush all the streams |
| java.lang.String | getName()
return the name of this writer or null if it is name-less |
| static void | main(java.lang.String[] argv)
|
| void | println()
Finish the line. |
| void | println(boolean x)
Print a boolean, and then finish the line. |
| void | println(char x)
Print a character, and then finish the line. |
| void | println(int x)
Print an integer, and then finish the line. |
| void | println(long x)
Print a long, and then finish the line. |
| void | println(float x)
Print a float, and then finish the line. |
| void | println(double x)
Print a double, and then finish the line. |
| void | println(char[] x)
Print a character array, and then finish the line. |
| void | println(java.lang.String x)
Print a boolean, and then finish the line. |
| void | println(java.lang.Object x)
Print a boolean, and then finish the line. |
| void | print(boolean x)
Print a boolean, and then finish the line. |
| void | print(char x)
Print a character. |
| void | print(int x)
Print an integer. |
| void | print(long x)
Print a long. |
| void | print(float x)
Print a float. |
| void | print(double x)
Print a double. |
| void | print(char[] x)
Print a character array. |
| void | print(java.lang.String x)
Print a boolean. |
| void | print(java.lang.Object x)
Print a boolean. |
| void | removeOutput(java.io.PrintWriter pw)
remove a PrintWriter from this object |
| void | removeOutput(java.io.Writer pw)
remove a Writer from this object |
| void | removeOutput(java.io.OutputStream pw)
remove an OutputStream from this object |
| void | setName(java.lang.String name)
set the name given to this writer |
| void | write(int c)
Write a single character. |
| void | write(char[] buf,
int off,
int len)
Write a portion of an array of characters. |
| void | write(java.lang.String s,
int off,
int len)
Write a portion of a string. |
| Methods inherited from class java.io.PrintWriter | |
| checkError, close, flush, println, println, println, println, println, println, println, println, println, println, print, print, print, print, print, print, print, print, print, setError, write, write, write, write, write | |
| Methods inherited from class java.io.Writer | |
| close, flush, write, write, write, write, write | |
| Methods inherited from class java.lang.Object | |
| clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait | |
| Field Detail |
protected MultiPrintWriter last
protected MultiPrintWriter next
protected java.io.PrintWriter mine
protected java.lang.String name
| Constructor Detail |
public MultiPrintWriter()
public MultiPrintWriter(java.io.Writer wr)
public MultiPrintWriter(java.io.Writer wr,
boolean autoflush)
public MultiPrintWriter(java.io.PrintWriter wr)
public MultiPrintWriter(java.io.PrintWriter wr,
boolean autoflush)
public MultiPrintWriter(java.io.OutputStream os)
public MultiPrintWriter(java.io.OutputStream os,
boolean autoflush)
| Method Detail |
public void setName(java.lang.String name)
public java.lang.String getName()
public void addOutput(java.io.Writer wr,
boolean autoFlush)
public void addOutput(java.io.Writer wr)
public void addOutput(java.io.OutputStream os,
boolean autoFlush)
public void addOutput(java.io.OutputStream os)
public void addOutput(java.io.PrintWriter wr)
public void removeOutput(java.io.PrintWriter pw)
public void removeOutput(java.io.Writer pw)
public void removeOutput(java.io.OutputStream pw)
public boolean contains(java.io.PrintWriter pw)
public boolean contains(java.io.Writer pw)
public boolean contains(java.io.OutputStream pw)
public boolean checkError()
public void write(int c)
public void write(char[] buf,
int off,
int len)
public void write(java.lang.String s,
int off,
int len)
public void println()
public void println(boolean x)
public void println(char x)
public void println(int x)
public void println(long x)
public void println(float x)
public void println(double x)
public void println(char[] x)
public void println(java.lang.String x)
public void println(java.lang.Object x)
public void print(boolean x)
public void print(char x)
public void print(int x)
public void print(long x)
public void print(float x)
public void print(double x)
public void print(char[] x)
public void print(java.lang.String x)
public void print(java.lang.Object x)
public void flush()
public void close()
public static void main(java.lang.String[] argv)
| Overview | Package | Class | Tree | Deprecated | Index | Help | |||
| PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||