java.lang.Object MyFile
public class MyFile
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 |
---|
int currentLocation
java.util.ArrayList<java.lang.String> fileContents
java.io.File theFile
Constructor Detail |
---|
public MyFile(java.lang.String str)
Method Detail |
---|
public boolean addToFile(java.lang.String str)
public java.lang.String allLines()
public boolean deleteLine(int line)
public java.lang.String nextLine()
public boolean replaceFile(java.lang.String str)