|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectIO
public final class IO
Utility class for basic IO functions.
| Field Summary | |
|---|---|
static java.io.PrintStream |
stderr
A PrintStream associated with stderr |
static java.io.BufferedReader |
stdin
A BufferedReader associated with the stdin stream |
static java.io.PrintStream |
stdout
A PrintStream associated with stdout |
| Method Summary | |
|---|---|
static boolean |
affirmative(java.lang.String yn)
Tests if a string value begins with 'y' or 'Y' |
static java.lang.String |
prompt(java.lang.String s)
Gets prompted input as a string from the user via stdin |
static int |
promptInt(java.lang.String s,
int low,
int high)
Gets prompted input parsed as an int within the specified range from the user via stdin |
static java.lang.String |
readFile(java.lang.String name)
Reads an entire file into a single string |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static java.io.BufferedReader stdin
public static java.io.PrintStream stdout
public static java.io.PrintStream stderr
| Method Detail |
|---|
public static boolean affirmative(java.lang.String yn)
yn - the string
public static java.lang.String readFile(java.lang.String name)
name - The filename to read
public static java.lang.String prompt(java.lang.String s)
s - The prompt to display on stdout to request input
public static int promptInt(java.lang.String s,
int low,
int high)
s - The prompt to display on stdout to request inputlow - The low value of the acceptable range of inputhigh - The high vaue of the range
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||