Class file

java.lang.Object
  |
  +--file

public class file
extends java.lang.Object

This is a class for reading and writing textfiles. basic use :


Constructor Summary
file()
           
 
Method Summary
 void close()
          close both the file opened for reading and the one for writing (if any)
static double dnum(java.lang.String s)
          converts a String to a double.
static int num(java.lang.String s)
          converts a String to an int.
 java.lang.String read()
          read one line of the input file.
 void readclose()
          close the file opened for reading.
 void readopen(java.io.File f1)
          open a file for reading.
 void readopen(java.lang.String f1)
          open a file for reading.
 void write(java.lang.String s)
          Write out the given string as a separate line.
 void writeopen(java.io.File f1)
          open a file for writing.
 void writeopen(java.lang.String f1)
          open a file for writing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

file

public file()
Method Detail

readopen

public void readopen(java.lang.String f1)
open a file for reading.

readopen

public void readopen(java.io.File f1)
open a file for reading.

read

public java.lang.String read()
read one line of the input file.

readclose

public void readclose()
close the file opened for reading.

writeopen

public void writeopen(java.lang.String f1)
open a file for writing. Note that it is allowed to have both a file to read and a file to write with the same file object.

writeopen

public void writeopen(java.io.File f1)
open a file for writing. Note that it is allowed to have both a file to read and a file to write with the same file object.

write

public void write(java.lang.String s)
Write out the given string as a separate line.

close

public void close()
close both the file opened for reading and the one for writing (if any)

num

public static int num(java.lang.String s)
converts a String to an int.

dnum

public static double dnum(java.lang.String s)
converts a String to a double.