|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjutil.IOUtils
public class IOUtils
Utilities for console and file I/O.
Field Summary | |
---|---|
static java.io.PrintWriter |
stderr
Represents standard error stream; default destination is console window unless redirected at the command line. |
static java.io.BufferedReader |
stdin
Represents standard input stream; default source is keyboard unless redirected at the command line. |
static java.io.PrintWriter |
stdout
Represents standard output stream; default destination is console window unless redirected at the command line. |
Constructor Summary | |
---|---|
IOUtils()
|
Method Summary | |
---|---|
static void |
error(java.lang.String gripe)
Prints an error message to stderr. |
static java.io.BufferedReader |
makeReader(java.lang.String fname)
A factory for turning file names into character input streams. |
static java.io.PrintWriter |
makeWriter(java.lang.String fname)
A factory for turning file names into character output streams. |
static void |
print(java.io.PrintWriter writer,
java.lang.String msg)
Prints a message to a character output stream without a newline. |
static void |
print(java.lang.String msg)
Prints a message to stdout without a newline. |
static void |
println(java.io.PrintWriter writer,
java.lang.String msg)
Prints a message to a character output stream with a newline. |
static void |
println(java.lang.String msg)
Prints a message to stdout with a newline. |
static java.lang.String |
readLine()
Reads a line from stdin without throwing an exception. |
static java.lang.String |
readLine(java.io.BufferedReader reader)
Reads a line from a reader without throwing an exception. |
static void |
seriousError(java.lang.String gripe)
Prints an error message to stdout then terminates the application. |
static java.util.StringTokenizer |
tokenize(java.lang.String tokens)
Parses a string into a sequence of tokens. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.io.BufferedReader stdin
public static final java.io.PrintWriter stdout
public static final java.io.PrintWriter stderr
Constructor Detail |
---|
public IOUtils()
Method Detail |
---|
public static java.io.PrintWriter makeWriter(java.lang.String fname)
fname
- the name of the file to be written
public static java.io.BufferedReader makeReader(java.lang.String fname)
fname
- The name of the text file to be read.
public static java.lang.String readLine(java.io.BufferedReader reader)
reader
- a character input stream
public static java.lang.String readLine()
public static void print(java.io.PrintWriter writer, java.lang.String msg)
writer
- a file output streammsg
- the message displayedpublic static void println(java.io.PrintWriter writer, java.lang.String msg)
writer
- a file output streammsg
- the message displayedpublic static void print(java.lang.String msg)
msg
- the message displayedpublic static void println(java.lang.String msg)
msg
- the message displayedpublic static java.util.StringTokenizer tokenize(java.lang.String tokens)
tokens
- the string to be parsed
public static void error(java.lang.String gripe)
gripe
- the error messagepublic static void seriousError(java.lang.String gripe)
gripe
- the error message
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |