|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.javatest.util.LineParser
public class LineParser
A class to parse lines of words in a stream. Words may be unquoted sequences of non-blank characters, or may be quoted strings. Comments can be introduced by '#' and extend to the next newline character. Lines may be terminated by newline, semicolon or a comment.
Nested Class Summary | |
---|---|
static class |
LineParser.Fault
This exception is used to report problems while using a line parser. |
Constructor Summary | |
---|---|
LineParser(java.io.File file)
Create a line parser, reading the data in a given file. |
|
LineParser(java.io.Reader in)
Create a line parser, reading data from an anonymous stream. |
Method Summary | |
---|---|
java.io.File |
getFile()
Get the file being read, or null if it is not available. |
int |
getLineNumber()
Get the current line number within the stream being read. |
java.lang.String[] |
readLine()
Read the next line of words from the input stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LineParser(java.io.File file) throws java.io.FileNotFoundException, java.io.IOException
file
- the file to be read
java.io.FileNotFoundException
- if the file was not found
java.io.IOException
- if there is some problem opening the file
or reading the initial characters of the filepublic LineParser(java.io.Reader in)
in
- the stream from which to read the dataMethod Detail |
---|
public java.io.File getFile()
public int getLineNumber()
public java.lang.String[] readLine() throws LineParser.Fault
LineParser.Fault
- if there is a problem reading the required data --
such as an unterminated string
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |