canvas
Class Transcript

java.lang.Object
  |
  +--canvas.Transcript

public class Transcript
extends Object

Provides services to record textual output to a file or display it in a window. If println(Object) is called before setApplet(Object), a file transcript.txt will be opened in the current directory. If setApplet() called first, a new window will be created, and any subsequent printlns or prints will not cause a file to be opened. Instead, output will be printed in the window.


Constructor Summary
Transcript()
           
 
Method Summary
static void print(Object o)
          Prints, without a carriage return, the object passed in.
static void println(Object o)
          Prints, with a trailing carriage return, the object passed in.
static void setApplet(Object o)
          Call this with a non-null object to create a window to which the output is printed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Transcript

public Transcript()
Method Detail

setApplet

public static void setApplet(Object o)
Call this with a non-null object to create a window to which the output is printed. If the argument is null, an Error is thrown. If applet has already been set, an Error is thrown. If the file has already been opened with a print or println statement, an Error is thrown.


print

public static void print(Object o)
Prints, without a carriage return, the object passed in. (equivalent to System.out.print) The printed output goes to standard out, and either the file transcript.txt or the Transcript window, depending on whether or not the program is running as an applet.


println

public static void println(Object o)
Prints, with a trailing carriage return, the object passed in. (equivalent to System.out.println) The printed output goes to standard out, and either the file transcript.txt or the Transcript window, depending on whether or not the program is running as an applet.