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 ofToken
s. 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 boolean
hasNext()
Check if there is a next input tokenToken
next()
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:
hasNext
in interfacejava.util.Iterator<Token>
- Returns:
- returns true if there are more tokens on input stream
-
-