|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Writer
java.io.PrintWriter
gpdraw.FileOutput
public class FileOutput
FileOutput provides simple methods for opening and writing to text files. This class implements most of the print methods found in PrintWriter.
Methods in this class never throw I/O exceptions. The client may inquire as to whether any errors have occurred by invoking checkError().
Example: ======= FileOutput outFile = new FileOutput("anyname.txt"); outFile.print("2 + 2 = "); outFile.println(4); outFile.printf("e = %+10.4f", Math.E); // -> "e = +2.7183" outFile.println(); // an extra blank line outFile.close(); // optional
PrintWriter
Constructor Summary | |
---|---|
FileOutput(java.lang.String fileName)
Constructor. |
|
FileOutput(java.lang.String fileName,
java.lang.String mode)
Constructor. |
Method Summary |
---|
Methods inherited from class java.io.PrintWriter |
---|
append, append, append, checkError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, write, write, write, write, write |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileOutput(java.lang.String fileName)
fileName
- the name of the file to be createdpublic FileOutput(java.lang.String fileName, java.lang.String mode)
fileName
- the name of the file to be createdmode
- if equals to "a" || "app" || "append" opens in append mode
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |