| java.lang.Object com.ibm.icu.text.StringMatcher
StringMatcher | class StringMatcher implements UnicodeMatcher,UnicodeReplacer(Code) | | An object that matches a fixed input string, implementing the
UnicodeMatcher API. This object also implements the
UnicodeReplacer API, allowing it to emit the matched text as
output. Since the match text may contain flexible match elements,
such as UnicodeSets, the emitted text is not the match pattern, but
instead a substring of the actual matched text. Following
convention, the output text is the leftmost match seen up to this
point.
A StringMatcher may represent a segment, in which case it has a
positive segment number. This affects how the matcher converts
itself to a pattern but does not otherwise affect its function.
A StringMatcher that is not a segment should not be used as a
UnicodeReplacer.
|
StringMatcher | public StringMatcher(String theString, int segmentNum, RuleBasedTransliterator.Data theData)(Code) | | Construct a matcher that matches the given pattern string.
Parameters: theString - the pattern to be matched, possibly containingstand-ins that represent nested UnicodeMatcher objects. Parameters: segmentNum - the segment number from 1..n, or 0 if this isnot a segment. Parameters: theData - context object mapping stand-ins toUnicodeMatcher objects. |
StringMatcher | public StringMatcher(String theString, int start, int limit, int segmentNum, RuleBasedTransliterator.Data theData)(Code) | | Construct a matcher that matches a substring of the given
pattern string.
Parameters: theString - the pattern to be matched, possibly containingstand-ins that represent nested UnicodeMatcher objects. Parameters: start - first character of theString to be matched Parameters: limit - index after the last character of theString to bematched. Parameters: segmentNum - the segment number from 1..n, or 0 if this isnot a segment. Parameters: theData - context object mapping stand-ins toUnicodeMatcher objects. |
addMatchSetTo | public void addMatchSetTo(UnicodeSet toUnionTo)(Code) | | Implementation of UnicodeMatcher API. Union the set of all
characters that may be matched by this object into the given
set.
Parameters: toUnionTo - the set into which to union the source characters |
addReplacementSetTo | public void addReplacementSetTo(UnicodeSet toUnionTo)(Code) | | Union the set of all characters that may output by this object
into the given set.
Parameters: toUnionTo - the set into which to union the output characters |
matches | public int matches(Replaceable text, int[] offset, int limit, boolean incremental)(Code) | | Implement UnicodeMatcher
|
matchesIndexValue | public boolean matchesIndexValue(int v)(Code) | | Implement UnicodeMatcher
|
replace | public int replace(Replaceable text, int start, int limit, int[] cursor)(Code) | | UnicodeReplacer API
|
resetMatch | public void resetMatch()(Code) | | Remove any match data. This must be called before performing a
set of matches with this segment.
|
toPattern | public String toPattern(boolean escapeUnprintable)(Code) | | Implement UnicodeMatcher
|
toReplacerPattern | public String toReplacerPattern(boolean escapeUnprintable)(Code) | | UnicodeReplacer API
|
|
|