public class InputTextReader extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static int |
MAX_BACKTRACK_MULTIPLIER
The number of times something can be backtracked is this multiplier times the length of the string.
|
| Constructor and Description |
|---|
InputTextReader(String content)
Creates a new instance of the InputTextReader using the content to read.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canReadChars(int numberChars)
Returns true if the reader has more the specified number of chars.
|
boolean |
eof()
Checks if the current stream is at the end.
|
int |
getBacktrackedCount()
Gets the total number of characters that were backtracked when reading.
|
int |
getPosition()
Gets the current position in the stream.
|
void |
goBack()
Goes back a single character.
|
String |
peek(int numberChars)
Peeks at the next number of chars and returns as a string without incrementing the current index.
|
char |
peekChar(int offset)
Gets the character in the array offset by the current index.
|
char |
read()
Reads a single char from the content stream and increments the index.
|
void |
seek(int position)
Moves the index to the specified position.
|
protected static final int MAX_BACKTRACK_MULTIPLIER
public InputTextReader(String content)
content - The content to read.public char read()
public String peek(int numberChars)
numberChars - The number of chars to peek.public char peekChar(int offset)
offset - The number of characters to offset.public boolean canReadChars(int numberChars)
numberChars - The number of chars to see if we can read.public boolean eof()
public int getPosition()
public int getBacktrackedCount()
public void seek(int position)
position - The position to set the index to.public void goBack()
Copyright © 2016. All rights reserved.