public abstract class SymbolMatcher extends Object implements NumberParseMatcher
NumberParseMatcher.Flexible| Modifier and Type | Field and Description |
|---|---|
protected String |
string |
protected UnicodeSet |
uniSet |
| Modifier | Constructor and Description |
|---|---|
protected |
SymbolMatcher(StaticUnicodeSets.Key key) |
protected |
SymbolMatcher(String symbolString,
UnicodeSet symbolUniSet) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
accept(StringSegment segment,
ParsedNumber result) |
UnicodeSet |
getSet() |
protected abstract boolean |
isDisabled(ParsedNumber result) |
boolean |
match(StringSegment segment,
ParsedNumber result)
Runs this matcher starting at the beginning of the given StringSegment.
|
void |
postProcess(ParsedNumber result)
Method called at the end of a parse, after all matchers have failed to consume any more chars.
|
boolean |
smokeTest(StringSegment segment)
Performs a fast "smoke check" for whether or not this matcher could possibly match against the
given string segment.
|
protected final String string
protected final UnicodeSet uniSet
protected SymbolMatcher(String symbolString, UnicodeSet symbolUniSet)
protected SymbolMatcher(StaticUnicodeSets.Key key)
public UnicodeSet getSet()
public boolean match(StringSegment segment, ParsedNumber result)
NumberParseMatchermatch in interface NumberParseMatchersegment - The StringSegment to match against. Matches always start at the beginning of the
segment. The segment is guaranteed to contain at least one char.result - The data structure to store results if the match succeeds.public boolean smokeTest(StringSegment segment)
NumberParseMatcherStringSegment.startsWith(int) method in order to correctly
handle case folding.smokeTest in interface NumberParseMatchersegment - The segment to check against.public void postProcess(ParsedNumber result)
NumberParseMatcherpostProcess in interface NumberParseMatcherresult - The data structure to store results.protected abstract boolean isDisabled(ParsedNumber result)
protected abstract void accept(StringSegment segment, ParsedNumber result)