public class FileInput
extends java.lang.Object
| Constructor and Description |
|---|
FileInput(java.lang.String inputFileName)
Open the input file.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the input file.
|
boolean |
eof()
Returns whether or not end-of-file has been reached.
|
double[] |
loadFileAsDoubleArray()
Return the lines of the file in a
double []. |
java.util.ArrayList<java.lang.Double> |
loadFileAsDoubleList()
Return the lines of the file in an
ArrayList<Double>. |
int[] |
loadFileAsIntArray()
Return the lines of the file in an
int []. |
java.util.ArrayList<java.lang.Integer> |
loadFileAsIntegerList()
Return the lines of the file in an
ArrayList<Integer>. |
java.lang.String[] |
loadFileAsStringArray()
Return the lines of the file in a
String []. |
java.util.ArrayList<java.lang.String> |
loadFileAsStringList()
Return the lines of the file in an
ArrayList<String>. |
java.lang.String |
readLine()
Read a line from the input file.
|
double |
readLineDouble()
Read a line consisting of a single
double from the input file. |
double[] |
readLineDoubles()
Read a line from the input file.
|
int |
readLineInt()
Read a line consisting of a single
int from the input file. |
int[] |
readLineInts()
Read a line from the input file.
|
java.lang.String[] |
readLineTokens()
Read a line from the input file.
|
public FileInput(java.lang.String inputFileName)
inputFileName - The input file name.public void close()
public boolean eof()
public java.lang.String readLine()
null if boolean eof() returns true.public int readLineInt()
int from the input file.
If boolean eof() returns true, then this method will throw a RuntimeException.public double readLineDouble()
double from the input file.
If boolean eof() returns true, then this method will throw a RuntimeException.public java.lang.String[] readLineTokens()
boolean eof() returns true, then this method will throw a RuntimeException.public int[] readLineInts()
boolean eof() returns true, then this method will throw a RuntimeException.public double[] readLineDoubles()
boolean eof() returns true, then this method will throw a RuntimeException.public java.util.ArrayList<java.lang.String> loadFileAsStringList()
ArrayList<String>.public java.lang.String[] loadFileAsStringArray()
String [].public java.util.ArrayList<java.lang.Integer> loadFileAsIntegerList()
ArrayList<Integer>.public int[] loadFileAsIntArray()
int [].public java.util.ArrayList<java.lang.Double> loadFileAsDoubleList()
ArrayList<Double>.public double[] loadFileAsDoubleArray()
double [].