public class InputReader extends Object
| Constructor and Description |
|---|
InputReader(Reader reader)
Construct a InputReader from a string.
|
InputReader(String s)
Construct a InputReader from a string.
|
| Modifier and Type | Method and Description |
|---|---|
void |
back()
Back up one character.
|
InputException |
error(String message)
Resturns InputException to signal a syntax error.
|
boolean |
more()
Determine if the source string still contains characters that next()
can consume.
|
char |
next()
Get the next character in the source string.
|
String |
next(int n)
Get the next n characters.
|
char |
nextNonSpace()
Get the next char in the string, skipping whitespace.
|
public InputReader(Reader reader)
reader - A reader.public InputReader(String s)
s - A source string.public void back()
throws InputException
InputExceptionpublic char next()
throws InputException
InputExceptionpublic InputException error(String message)
message - The error message.public char nextNonSpace()
throws InputException
InputExceptionpublic String next(int n) throws InputException
n - The number of characters to take.InputException - Substring bounds error if there are not
n characters remaining in the source string.public boolean more()
throws InputException
InputExceptionCopyright © 2017. All rights reserved.