proper.io
Class Tee

java.lang.Object
  extended by proper.io.Tee

public class Tee
extends java.lang.Object

This class pipelines print/println's to several PrintStreams, initially only to 'System.out'.

Version:
$Revision: 1.2 $
Author:
FracPete

Constructor Summary
Tee()
          initializes the object
 
Method Summary
 void add(java.io.PrintStream p)
          adds the given PrintStream to the list of streams, with NO timestamp
 void add(java.io.PrintStream p, boolean timestamp)
          adds the given PrintStream to the list of streams
 void clear()
          removes all streams and places System.out again in the list
 boolean contains(java.io.PrintStream p)
          checks whether the given PrintStream is already in the list
 void flush()
          flushes all the printstreams
 java.io.PrintStream get(int index)
          returns the specified PrintStream from the list
 void print(boolean x)
          prints the given boolean to the streams
 void print(int x)
          prints the given int to the streams
 void print(java.lang.Object x)
          prints the given object to the streams
 void print(java.lang.String x)
          prints the given string to the streams
 void println()
          prints a new line to the streams
 void println(boolean x)
          prints the given boolean to the streams
 void println(int x)
          prints the given int to the streams
 void println(java.lang.Object x)
          prints the given object to the streams (for Throwables we print the stack trace)
 void println(java.lang.String x)
          prints the given string to the streams
 java.io.PrintStream remove(int index)
          removes the given PrintStream from the list
 java.io.PrintStream remove(java.io.PrintStream p)
          removes the given PrintStream from the list
 int size()
          returns the number of streams currently in the list
 java.lang.String toString()
          returns only the classname
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Tee

public Tee()
initializes the object

Method Detail

clear

public void clear()
removes all streams and places System.out again in the list


add

public void add(java.io.PrintStream p)
adds the given PrintStream to the list of streams, with NO timestamp


add

public void add(java.io.PrintStream p,
                boolean timestamp)
adds the given PrintStream to the list of streams


get

public java.io.PrintStream get(int index)
returns the specified PrintStream from the list


remove

public java.io.PrintStream remove(java.io.PrintStream p)
removes the given PrintStream from the list


remove

public java.io.PrintStream remove(int index)
removes the given PrintStream from the list


contains

public boolean contains(java.io.PrintStream p)
checks whether the given PrintStream is already in the list


size

public int size()
returns the number of streams currently in the list


flush

public void flush()
flushes all the printstreams


print

public void print(int x)
prints the given int to the streams


print

public void print(boolean x)
prints the given boolean to the streams


print

public void print(java.lang.String x)
prints the given string to the streams


print

public void print(java.lang.Object x)
prints the given object to the streams


println

public void println()
prints a new line to the streams


println

public void println(int x)
prints the given int to the streams


println

public void println(boolean x)
prints the given boolean to the streams


println

public void println(java.lang.String x)
prints the given string to the streams


println

public void println(java.lang.Object x)
prints the given object to the streams (for Throwables we print the stack trace)


toString

public java.lang.String toString()
returns only the classname

Overrides:
toString in class java.lang.Object