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.
-
Terminal()
-
-
indent()
- Prints the current indentation to the command line.
-
print(Object)
- Print a string to the command line.
-
print(String)
- Print a string to the command line.
-
printCall(String)
- Print procedure call information to the command line with a
carriage return.
-
println(Object)
- Print an object to the command line with a carriage return.
-
println(String)
- Print a string to the command line with a carriage return.
-
printReturn(String)
- Print a return value to the command line with a
carriage return.
-
readDouble()
- Read a double from the command line
-
readInt()
- Read a integer from the command line
-
readWord()
- Read a string from the command line
-
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
-
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
-
stopTranscript()
- Stop the transcript file from logging input and output
Terminal
public Terminal()
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
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
stopTranscript
public static void stopTranscript()
- Stop the transcript file from logging input and output
- Returns:
- none
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
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
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
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
indent
public static void indent()
- Prints the current indentation to the command line.
- Returns:
- none
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
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
readDouble
public static double readDouble()
- Read a double from the command line
- Returns:
- a double
readInt
public static int readInt()
- Read a integer from the command line
- Returns:
- a integer
readWord
public static String readWord()
- Read a string from the command line
- Returns:
- a string
All Packages Class Hierarchy This Package Previous Next Index