public class FileIO
extends java.lang.Object
Constructor and Description |
---|
FileIO() |
Modifier and Type | Method and Description |
---|---|
void |
closeRead()
Calling this method closes the current file which is open for reading.
|
void |
closeWrite()
Calling this method closes the current file which is open for writing.
|
static java.lang.String |
getFileName(boolean save,
javafx.stage.Window stage)
Use this method to open a FileChooser to select a file to either save or
open.
|
boolean |
hasMoreData()
This method returns whether there is more data to be read from the file
that is currently open for reading.
|
void |
openRead(java.lang.String filename)
Opens the file specified by 'filename' for reading.
|
void |
openWrite(java.lang.String filename)
Opens the file specified by 'filename' for writing.
|
int |
readInt()
This method reads the next entry in the file and returns it as an int.
|
void |
writeInt(int num)
This method adds an entry to the end of the current file open for
writing.
|
public static java.lang.String getFileName(boolean save, javafx.stage.Window stage)
save
- - true if saving false if openingstage
- - your program's Stagepublic void openWrite(java.lang.String filename)
filename
- the pathname of the file to be opened for writing.public void writeInt(int num)
num
- the int to write to the filepublic void openRead(java.lang.String filename)
filename
- the pathname of the file to be opened for reading.public int readInt()
public void closeWrite()
public void closeRead()
public boolean hasMoreData()