Class ValidationMatcher
java.lang.Object
org.graalvm.shadowed.com.ibm.icu.impl.number.parse.ValidationMatcher
- All Implemented Interfaces:
NumberParseMatcher
- Direct Known Subclasses:
MultiplierParseHandler, RequireAffixValidator, RequireCurrencyValidator, RequireDecimalSeparatorValidator, RequireNumberValidator
A Matcher used only for post-process validation, not for consuming characters at runtime.
-
Nested Class Summary
Nested classes/interfaces inherited from interface NumberParseMatcher
NumberParseMatcher.Flexible -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanmatch(StringSegment segment, ParsedNumber result) Runs this matcher starting at the beginning of the given StringSegment.booleansmokeTest(StringSegment segment) Performs a fast "smoke check" for whether or not this matcher could possibly match against the given string segment.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface NumberParseMatcher
postProcess
-
Constructor Details
-
ValidationMatcher
public ValidationMatcher()
-
-
Method Details
-
match
Description copied from interface:NumberParseMatcherRuns 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.- Specified by:
matchin interfaceNumberParseMatcher- Parameters:
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.result- The data structure to store results if the match succeeds.- Returns:
- Whether this matcher thinks there may be more interesting chars beyond the end of the string segment.
-
smokeTest
Description copied from interface:NumberParseMatcherPerforms 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 theStringSegment.startsWith(int)method in order to correctly handle case folding.- Specified by:
smokeTestin interfaceNumberParseMatcher- Parameters:
segment- The segment to check against.- Returns:
- true if the matcher might be able to match against this segment; false if it definitely will not be able to match.
-