Class MyFile

java.lang.Object
  extended by MyFile

public class MyFile
extends java.lang.Object


Field Summary
(package private)  int currentLocation
           
(package private)  java.util.ArrayList<java.lang.String> fileContents
           
(package private)  java.io.File theFile
           
 
Constructor Summary
MyFile(java.lang.String str)
          When constructed, MyFile requires a string of the file location.
 
Method Summary
 boolean addToFile(java.lang.String str)
          Add String str to the end of the file
 java.lang.String allLines()
          Return the entire file as a string
 boolean deleteLine(int line)
          Deletes a line from the file
 java.lang.String nextLine()
          Returns the nextLine read from the file
 boolean replaceFile(java.lang.String str)
          This will replace (or create) a file with the contents String str
 
Methods inherited from class
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentLocation

int currentLocation

fileContents

java.util.ArrayList<java.lang.String> fileContents

theFile

java.io.File theFile
Constructor Detail

MyFile

public MyFile(java.lang.String str)
When constructed, MyFile requires a string of the file location. If in the same folder, just put its name, otherwise put its entire path like c:\test.txt

Method Detail

addToFile

public boolean addToFile(java.lang.String str)
Add String str to the end of the file


allLines

public java.lang.String allLines()
Return the entire file as a string


deleteLine

public boolean deleteLine(int line)
Deletes a line from the file


nextLine

public java.lang.String nextLine()
Returns the nextLine read from the file


replaceFile

public boolean replaceFile(java.lang.String str)
This will replace (or create) a file with the contents String str