edu.berkeley.guir.lib.gesture.util
Class TokenReader
java.lang.Object
|
+--java.io.Reader
|
+--edu.berkeley.guir.lib.gesture.util.TokenReader
- public class TokenReader
- extends Reader
An extension of a Reader to read and unread a stream a token at a time.
Someday will be able to ignore comments.
WARNING: For some reason, nesting TokenReaders does not work. I
don't know if it's a bug in the TokenReader or in the LineNumberReader.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
token
protected String token
isPushedBack
protected boolean isPushedBack
delegate
protected Reader delegate
TokenReader
public TokenReader(Reader reader)
read
public int read()
throws IOException
- Overrides:
read
in class Reader
read
public int read(char[] cbuf,
int off,
int len)
throws IOException
- Overrides:
read
in class Reader
readLine
public String readLine()
throws IOException
skip
public long skip(long n)
throws IOException
- Overrides:
skip
in class Reader
markSupported
public boolean markSupported()
- maybe someday it could, but for now it doesn't
- Overrides:
markSupported
in class Reader
mark
public void mark(int readAheadLimit)
throws IOException
- Overrides:
mark
in class Reader
reset
public void reset()
throws IOException
- Overrides:
reset
in class Reader
readToken
public String readToken()
throws IOException
readInt
public int readInt()
throws IOException,
NumberFormatException
readLong
public long readLong()
throws IOException,
NumberFormatException
readBoolean
public boolean readBoolean()
throws IOException
unreadString
public void unreadString(String s)
- can only unread 1 string at a time
close
public void close()
throws IOException
- Overrides:
close
in class Reader
main
public static void main(String[] args)