|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.meyling.principia.io.TextFileReader
Wrapper for the class FileReader.
| Field Summary | |
private boolean |
alreadyRead
is there a row in the read buffer? |
private BufferedReader |
in
file to read from |
private String |
inFileName
file name |
private String |
line
last read line |
private int |
lineNumber
line counter |
| Constructor Summary | |
TextFileReader(String inputName)
Creates a TextFileReader object. |
|
| Method Summary | |
void |
close()
Closes input. |
String |
getInFileName()
Get name of input file. |
String |
getLine()
Get currently read line. |
int |
getLineNumber()
Get currently read line number. |
String |
readLine()
For simple reading a complete line of the input file. |
void |
unReadLine()
Undos the readLine() method. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private BufferedReader in
private String inFileName
private int lineNumber
private String line
private boolean alreadyRead
| Constructor Detail |
public TextFileReader(String inputName)
throws IOException
TextFileReader object.inputName - name of the input fileIOException - if the buffered reader couldn't be created| Method Detail |
public void close()
public String readLine()
throws IOException
line
Comments are ignoredIOException - wenn ein Lesefehler auftrat
public void unReadLine()
throws IllegalStateException
readLine() method. Only one readLine()
call can be cancelled. Further calls lead to an IllegalStateException.
A following readLine() call gives the last result again.IllegalStateException - if undo isn't allowed any morepublic String getLine()
public int getLineNumber()
public String getInFileName()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||