| Modifier and Type | Class and Description |
|---|---|
| public static interface | NumberParseMatcher.Flexible
Matchers can implement the Flexible interface to indicate that they are optional and can be run repeatedly. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: Whether this matcher thinks there may be more interesting chars beyond the end of the string segment.The StringSegment to match against. Matches always start at the beginning of the
segment. The segment is guaranteed to contain at least one char. segment, ParsedNumber The data structure to store results if the match succeeds. result)Runs this matcher starting at the beginning of the given StringSegment. |
| public void | postProcess(ParsedNumber
The data structure to store results. result)Method called at the end of a parse, after all matchers have failed to consume any more chars. |
| public boolean | Returns: true if the matcher might be able to match against this segment; false if it definitely will not be able to match.The segment to check against. segment)Performs a fast "smoke check" for whether or not this matcher could possibly match against the given string segment. |
| match | back to summary |
|---|---|
| public boolean match(StringSegment segment, ParsedNumber result) Runs this matcher starting at the beginning of the given StringSegment. If this matcher finds something interesting in the StringSegment, it should update the offset of the StringSegment corresponding to how many chars were matched.
| |
| postProcess | back to summary |
|---|---|
| public void postProcess(ParsedNumber result) Method called at the end of a parse, after all matchers have failed to consume any more chars. Allows a matcher to make final modifications to the result given the knowledge that no more matches are possible.
| |
| smokeTest | back to summary |
|---|---|
| public boolean smokeTest(StringSegment segment) Performs a fast "smoke check" for whether or not this matcher could possibly match against the
given string segment. The test should be as fast as possible but also as restrictive as possible.
For example, matchers can maintain a UnicodeSet of all code points that count possibly start a
match. Matchers should use the
| |