org.strbio.io
Class PrintfTee

java.lang.Object
  extended by org.strbio.io.PrintfTee
All Implemented Interfaces:
Printf

public class PrintfTee
extends java.lang.Object
implements Printf

A printf object that forwards output to 2 Printf's.

  Version 1.0, 11/25/98 - original version.
  

Version:
1.0, 11/25/98
Author:
JMC

Constructor Summary
PrintfTee(Printf x, Printf y)
           
 
Method Summary
 void flush()
          Flushes the output if necessary.
 void printf(java.lang.String fmt)
          Prints a string to the output, without any formatting or parameter substitution (because there are no parameters)
 void printf(java.lang.String fmt, char x)
          Prints an integer to the output with some formatting.
 void printf(java.lang.String fmt, double x)
          Prints a double to the output with some formatting.
 void printf(java.lang.String fmt, float x)
          Prints a float to the output with some formatting.
 void printf(java.lang.String fmt, int x)
          Prints an integer to the output with some formatting.
 void printf(java.lang.String fmt, long x)
          Prints a long to the output with some formatting.
 void printf(java.lang.String fmt, java.lang.String x)
          Prints a String to the output with some formatting.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrintfTee

public PrintfTee(Printf x,
                 Printf y)
Method Detail

flush

public final void flush()
                 throws java.io.IOException
Description copied from interface: Printf
Flushes the output if necessary.

Specified by:
flush in interface Printf
Throws:
java.io.IOException

printf

public final void printf(java.lang.String fmt)
                  throws java.io.IOException
Description copied from interface: Printf
Prints a string to the output, without any formatting or parameter substitution (because there are no parameters)

Specified by:
printf in interface Printf
Throws:
java.io.IOException

printf

public final void printf(java.lang.String fmt,
                         double x)
                  throws java.io.IOException
Description copied from interface: Printf
Prints a double to the output with some formatting.

Specified by:
printf in interface Printf
Parameters:
fmt - The format string, like in C... should contain %f or something to that effect. Note that you don't do %lf, just %f.
x - The double to print.
Throws:
java.io.IOException

printf

public final void printf(java.lang.String fmt,
                         float x)
                  throws java.io.IOException
Description copied from interface: Printf
Prints a float to the output with some formatting.

Specified by:
printf in interface Printf
Parameters:
fmt - The format string, like in C... should contain %f or something to that effect.
x - The float to print.
Throws:
java.io.IOException

printf

public final void printf(java.lang.String fmt,
                         long x)
                  throws java.io.IOException
Description copied from interface: Printf
Prints a long to the output with some formatting.

Specified by:
printf in interface Printf
Parameters:
fmt - The format string, like in C... should contain %d or something to that effect. Note that you don't do %ld, just %d.
x - The long to print.
Throws:
java.io.IOException

printf

public final void printf(java.lang.String fmt,
                         int x)
                  throws java.io.IOException
Description copied from interface: Printf
Prints an integer to the output with some formatting.

Specified by:
printf in interface Printf
Parameters:
fmt - The format string, like in C... should contain %d or something to that effect.
x - The int to print.
Throws:
java.io.IOException

printf

public final void printf(java.lang.String fmt,
                         char x)
                  throws java.io.IOException
Description copied from interface: Printf
Prints an integer to the output with some formatting.

Specified by:
printf in interface Printf
Parameters:
fmt - The format string, like in C... should contain %c or something to that effect.
x - The char to print.
Throws:
java.io.IOException

printf

public final void printf(java.lang.String fmt,
                         java.lang.String x)
                  throws java.io.IOException
Description copied from interface: Printf
Prints a String to the output with some formatting.

Specified by:
printf in interface Printf
Parameters:
fmt - The format string, like in C... should contain %s or something to that effect. Note that unless you actually do some formatting (i.e %-3s) it's ususally faster to use the + operator.
x - The String to print.
Throws:
java.io.IOException