Top Description Fields Constructors Methods
com.ibm.icu.impl.number.parse

public abstract Class SymbolMatcher

extends Object
implements NumberParseMatcher
Class Inheritance
All Implemented Interfaces
com.ibm.icu.impl.number.parse.NumberParseMatcher
Known Direct Subclasses
com.ibm.icu.impl.number.parse.IgnorablesMatcher, com.ibm.icu.impl.number.parse.InfinityMatcher, com.ibm.icu.impl.number.parse.MinusSignMatcher, com.ibm.icu.impl.number.parse.NanMatcher, com.ibm.icu.impl.number.parse.PaddingMatcher, com.ibm.icu.impl.number.parse.PercentMatcher, com.ibm.icu.impl.number.parse.PermilleMatcher, com.ibm.icu.impl.number.parse.PlusSignMatcher
Imports
com.ibm.icu.impl.StaticUnicodeSets, .StringSegment, com.ibm.icu.text.UnicodeSet

A base class for many matchers that performs a simple match against a UnicodeString and/or UnicodeSet.
Author
sffc

Field Summary

Modifier and TypeField and Description
protected final String
protected final UnicodeSet

Constructor Summary

AccessConstructor and Description
protected
SymbolMatcher(String symbolString, UnicodeSet symbolUniSet)

protected

Method Summary

Modifier and TypeMethod and Description
protected abstract void
public UnicodeSet
protected abstract boolean
public boolean
match(StringSegment
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
)

Implements com.ibm.icu.impl.number.parse.NumberParseMatcher.match.

Runs this matcher starting at the beginning of the given StringSegment.
public void
postProcess(ParsedNumber
The data structure to store results.
result
)

Implements com.ibm.icu.impl.number.parse.NumberParseMatcher.postProcess.

Method called at the end of a parse, after all matchers have failed to consume any more chars.
public boolean
smokeTest(StringSegment
The segment to check against.
segment
)

Implements com.ibm.icu.impl.number.parse.NumberParseMatcher.smokeTest.

Performs a fast "smoke check" for whether or not this matcher could possibly match against the given string segment.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

stringback to summary
protected final String string
uniSetback to summary
protected final UnicodeSet uniSet

Constructor Detail

SymbolMatcherback to summary
protected SymbolMatcher(String symbolString, UnicodeSet symbolUniSet)
SymbolMatcherback to summary
protected SymbolMatcher(StaticUnicodeSets.Key key)

Method Detail

acceptback to summary
protected abstract void accept(StringSegment segment, ParsedNumber result)
getSetback to summary
public UnicodeSet getSet()
isDisabledback to summary
protected abstract boolean isDisabled(ParsedNumber result)
matchback to summary
public boolean match(StringSegment segment, ParsedNumber result)

Implements com.ibm.icu.impl.number.parse.NumberParseMatcher.match.

Doc from com.ibm.icu.impl.number.parse.NumberParseMatcher.match.

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.

Parameters
segment:StringSegment

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:ParsedNumber

The data structure to store results if the match succeeds.

Returns:boolean

Whether this matcher thinks there may be more interesting chars beyond the end of the string segment.

Annotations
@Override
postProcessback to summary
public void postProcess(ParsedNumber result)

Implements com.ibm.icu.impl.number.parse.NumberParseMatcher.postProcess.

Doc from com.ibm.icu.impl.number.parse.NumberParseMatcher.postProcess.

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.

Parameters
result:ParsedNumber

The data structure to store results.

Annotations
@Override
smokeTestback to summary
public boolean smokeTest(StringSegment segment)

Implements com.ibm.icu.impl.number.parse.NumberParseMatcher.smokeTest.

Doc from com.ibm.icu.impl.number.parse.NumberParseMatcher.smokeTest.

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 StringSegment#startsWith method in order to correctly handle case folding.

Parameters
segment:StringSegment

The segment to check against.

Returns:boolean

true if the matcher might be able to match against this segment; false if it definitely will not be able to match.

Annotations
@Override