Class Reader
- java.lang.Object
-
- Reader
-
- All Implemented Interfaces:
java.util.Iterator<Token>
public class Reader extends java.lang.Object implements java.util.Iterator<Token>
A simple input stream that parses postscript files and generates a stream ofTokens. If constructed with no arguments, the Reader will process tokens from the terminal. To process tokens from a file, use the construtor that takes a String.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()Check if there is a next input tokenTokennext()Get the next input token
-
-
-
Constructor Detail
-
Reader
public Reader()
Constructs a reader of postscript tokens from System.in (the terminal)
-
Reader
public Reader(java.lang.String filename)
Constructs a reader of postscript tokens from the file with the given filename.- Parameters:
filename- the file to read postscript tokens from
-
-
Method Detail
-
hasNext
public boolean hasNext()
Check if there is a next input token- Specified by:
hasNextin interfacejava.util.Iterator<Token>- Returns:
- returns true if there are more tokens on input stream
-
-