All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class cs101.terminal.Terminal

java.lang.Object
   |
   +----cs101.terminal.Terminal

public class Terminal
extends Object
Class to facilitate input and output from the command line.


Constructor Index

 o Terminal()

Method Index

 o indent()
Prints the current indentation to the command line.
 o print(Object)
Print a string to the command line.
 o print(String)
Print a string to the command line.
 o printCall(String)
Print procedure call information to the command line with a
carriage return.
 o println(Object)
Print an object to the command line with a carriage return.
 o println(String)
Print a string to the command line with a carriage return.
 o printReturn(String)
Print a return value to the command line with a
carriage return.
 o readDouble()
Read a double from the command line
 o readInt()
Read a integer from the command line
 o readWord()
Read a string from the command line
 o startTranscript(String)
Start a transcript file that logs all input and output
The file is saved to the same directory as the project file
Under Windows 95, use Cafe/Word/WordPad to view the text file
 o startTranscript(String, boolean)
Start a transcript file that logs all input and output
The file is saved to the same directory as the project file
Under Windows 95, use Cafe/Word/WordPad to view the text file
 o stopTranscript()
Stop the transcript file from logging input and output

Constructors

 o Terminal
 public Terminal()

Methods

 o startTranscript
 public static void startTranscript(String fn)
Start a transcript file that logs all input and output
The file is saved to the same directory as the project file
Under Windows 95, use Cafe/Word/WordPad to view the text file

Parameters:
fn - string to call transcript file
Returns:
none
 o startTranscript
 public static void startTranscript(String fn,
                                    boolean controller)
Start a transcript file that logs all input and output
The file is saved to the same directory as the project file
Under Windows 95, use Cafe/Word/WordPad to view the text file

Parameters:
fn - string to call transcript file
controller - true if pause/resume/stop buttons desired
Returns:
none
 o stopTranscript
 public static void stopTranscript()
Stop the transcript file from logging input and output

Returns:
none
 o println
 public static void println(String s)
Print a string to the command line with a carriage return.
Indentation added if printCall and printReturn are used.

Parameters:
s - string to output
Returns:
none
 o print
 public static void print(String s)
Print a string to the command line. No indentation is added.

Parameters:
s - string to output
Returns:
none
 o println
 public static void println(Object x)
Print an object to the command line with a carriage return.
Indentation added if printCall and printReturn are used.

Parameters:
s - string to output
Returns:
none
 o print
 public static void print(Object x)
Print a string to the command line. No indentation is added.

Parameters:
s - string to output
Returns:
none
 o indent
 public static void indent()
Prints the current indentation to the command line.

Returns:
none
 o printCall
 public static void printCall(String s)
Print procedure call information to the command line with a
carriage return. Indentation is increased for future println
and indent calls.

Parameters:
s - procedure call information to output
Returns:
none
 o printReturn
 public static void printReturn(String s)
Print a return value to the command line with a
carriage return. Indentation is decreased for future println
and indent calls.

Parameters:
s - string (the formatted return value) to output
Returns:
none
 o readDouble
 public static double readDouble()
Read a double from the command line

Returns:
a double
 o readInt
 public static int readInt()
Read a integer from the command line

Returns:
a integer
 o readWord
 public static String readWord()
Read a string from the command line

Returns:
a string

All Packages  Class Hierarchy  This Package  Previous  Next  Index