chn.util
Class FileOutput

java.lang.Object
  |
  +--chn.util.FileOutput

public class FileOutput
extends java.lang.Object


Constructor Summary
FileOutput(java.lang.String fileName)
          Opens the given file for writing.
FileOutput(java.lang.String fileName, java.lang.String mode)
          If mode = "append" then this constructor opens the given file so that calls to print methods will append information to any existing information in the file.
 
Method Summary
 void close()
          Close the input file.
 void print(boolean bool)
          print the boolean to the file
 void print(char ch)
          print the character to the file
 void print(double val)
          print the double to the file
 void print(int num)
          print the integer to the file
 void print(java.lang.String str)
          print the String to the file
 void println()
          print a newline to the file
 void println(boolean bool)
          print the boolean to the file, followed by a newline
 void println(char ch)
          print the character to the file, followed by a newline
 void println(double val)
          print the double to the file, followed by a newline
 void println(int num)
          print the integer to the file, followed by a newline
 void println(java.lang.String str)
          print the String to the file, followed by a newline
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileOutput

public FileOutput(java.lang.String fileName)
Opens the given file for writing. If the file already exists, then any contents will be destroyed. If the file does not exist, it will be created with the given name.

FileOutput

public FileOutput(java.lang.String fileName,
                  java.lang.String mode)
If mode = "append" then this constructor opens the given file so that calls to print methods will append information to any existing information in the file. If the file does not exist, it will be created with the given name. If mode = "write" then this constructor opens the given file for writing, as in the one-parameter constgructor.
Method Detail

close

public void close()
Close the input file. Any attempt to write to this object after this function has been called will result in an error.

print

public void print(int num)
print the integer to the file

print

public void print(double val)
print the double to the file

print

public void print(java.lang.String str)
print the String to the file

print

public void print(boolean bool)
print the boolean to the file

print

public void print(char ch)
print the character to the file

println

public void println()
print a newline to the file

println

public void println(int num)
print the integer to the file, followed by a newline

println

public void println(double val)
print the double to the file, followed by a newline

println

public void println(java.lang.String str)
print the String to the file, followed by a newline

println

public void println(boolean bool)
print the boolean to the file, followed by a newline

println

public void println(char ch)
print the character to the file, followed by a newline