public interface InputContext
This is used by helper classes like NumberMatcher that let you change the way certain
things get parsed.
The actual implementation of this is the (internal and very complicated) WorkingDocument
class.
| Modifier and Type | Method and Description |
|---|---|
int |
charAt(int index)
Returns the character at the given index in the input document,
or -1 if the index is not contained within the document.
|
CharSequence |
extract()
Extracts a copy of the current entire content of the input as a
CharSequence |
CharSequence |
extract(int startIndex,
int endIndex)
Extracts a copy of a slice of the current entire content of the input as a
CharSequence,
including all characters with startIndex <= index < endIndex. |
SnuggleInput |
getInput()
Accesses the underlying
SnuggleInput |
int |
indexOf(int startSearchIndex,
char c)
Returns the first index of the given character, starting the search at the given
index.
|
int |
indexOf(int startSearchIndex,
String s)
Returns the first index of the given String, starting the search at the given
index.
|
boolean |
isRegionWhitespace(int startIndex,
int endIndex)
Tests whether all characters in the document with index satisfying
startIndex <= index < endIndex are whitespace.
|
int |
length()
Current length of this input
|
boolean |
matchesAt(int index,
char c)
Tests whether the character at the given index is equal to that specified.
|
boolean |
matchesAt(int index,
String s)
Tests whether the characters at the given index are equal to the String specified.
|
SnuggleInput getInput()
SnuggleInputint length()
int charAt(int index)
boolean matchesAt(int index,
char c)
boolean matchesAt(int index,
String s)
int indexOf(int startSearchIndex,
char c)
int indexOf(int startSearchIndex,
String s)
boolean isRegionWhitespace(int startIndex,
int endIndex)
CharSequence extract()
CharSequenceCharSequence extract(int startIndex, int endIndex)
CharSequence,
including all characters with startIndex <= index < endIndex.Copyright © 2008–2026 The University of Edinburgh. All rights reserved.