|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pz.platypus.TextFileReader
public class TextFileReader
Reads files consisting of lines of text, one line at a time. All standard I/O handled here. Used for reading config and resource files.
Field Summary | |
---|---|
private java.lang.String |
filename
|
private java.io.BufferedReader |
reader
|
private boolean |
trimWhitespace
|
Constructor Summary | |
---|---|
TextFileReader(java.lang.String fileName)
Create an instance of org.pz.platypus.TextFileReader to read the specified file |
Method Summary | |
---|---|
void |
open()
opens the reader for the indicated file |
java.lang.String |
retrieveNextLine()
Reads a line, optionally trims trailing whitespace, and returns it |
void |
setTrimWhiteSpace(boolean yesNo)
Set whether the reader should trim whitespace on lines read in |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.String filename
private java.io.BufferedReader reader
private boolean trimWhitespace
Constructor Detail |
---|
public TextFileReader(java.lang.String fileName)
fileName
- name of the file to read
java.lang.IllegalArgumentException
- if filename is nullMethod Detail |
---|
public void open() throws java.io.FileNotFoundException
java.io.FileNotFoundException
- if the file specified by filename does not exist.public java.lang.String retrieveNextLine() throws java.io.IOException
java.io.IOException
- if an error occurs reading the filepublic void setTrimWhiteSpace(boolean yesNo)
yesNo
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |