|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.agentfactory.platform.util.Scanner
public class Scanner
This class provides support for parsing of textual content. It breaks the text up in to a set of statements that are delimited by a carriage return, such as: COMMAND arg1 arg2 ... TO DO (Rem Collier): Implement support for multi-line statements that take the form: COMMAND { arg1 arg2 } NOTE: In this revised format, each argument in the statement will be delimited based only on the end of line character. Finally, the scanner is designed to ignore both single line and multi line comments (based on Java style syntax).
| Constructor Summary | |
|---|---|
Scanner(java.io.InputStream in)
Create a scanner based on an input stream by wrapping the InputStream object in an InputStreamReader. |
|
Scanner(java.io.Reader in)
Create a scanner based a Reader object. |
|
Scanner(java.lang.String text)
Create a scanner based on some text by wrapping the text in a StringReader. |
|
| Method Summary | |
|---|---|
void |
close()
close the underlying BufferedReader |
boolean |
hasNext()
Checks whether or not the scanner has any more statements |
java.util.List |
nextStatement()
This method reads from the BufferedReader, character by character, generating a list of tokens that represent a single statement from the file (based on the syntax requirements laid down in the class comment). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Scanner(java.io.InputStream in)
in - the InputStream object.public Scanner(java.lang.String text)
text - the text that the scanner is to scan.public Scanner(java.io.Reader in)
in - the Reader object whose output is to be scanned.| Method Detail |
|---|
public java.util.List nextStatement()
throws java.io.IOException
java.io.IOExceptionpublic boolean hasNext()
public void close()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||