| Modifier and Type | Field and Description |
|---|---|
| private final RuleBasedTransliterator. | data
Context object that maps stand-ins to matcher and replacer objects. |
| private int | matchLimit
Limit offset, in the match text, of the rightmost match. |
| private int | matchStart
Start offset, in the match text, of the rightmost match. |
| private String | pattern
The text to be matched. |
| private int | segmentNumber
The segment number, 1-based, or 0 if not a segment. |
| Access | Constructor and Description |
|---|---|
| public | StringMatcher(String
the pattern to be matched, possibly containing
stand-ins that represent nested UnicodeMatcher objects. theString, int the segment number from 1..n, or 0 if this is
not a segment. segmentNum, RuleBasedTransliterator.context object mapping stand-ins to
UnicodeMatcher objects. theDataConstruct a matcher that matches the given pattern string. |
| public | StringMatcher(String
the pattern to be matched, possibly containing
stand-ins that represent nested UnicodeMatcher objects. theString, int first character of theString to be matched start, int index after the last character of theString to be
matched. limit, int the segment number from 1..n, or 0 if this is
not a segment. segmentNum, RuleBasedTransliterator.context object mapping stand-ins to
UnicodeMatcher objects. theDataConstruct a matcher that matches a substring of the given pattern string. |
| Modifier and Type | Method and Description |
|---|---|
| public void | addMatchSetTo(UnicodeSet
the set into which to union the source characters toUnionTo)Implements com. |
| public void | addReplacementSetTo(UnicodeSet
the set into which to union the output characters toUnionTo)Implements com. |
| public int | matches(Replaceable
the text to be matched text, int[] on input, the index into text at which to begin
matching. On output, the limit of the matched text. The
number of matched characters is the output value of offset
minus the input value. Offset should always point to the
HIGH SURROGATE (leading code unit) of a pair of surrogates,
both on entry and upon return. offset, int the limit index of text to be matched. Greater
than offset for a forward direction match, less than offset for
a backward direction match. The last character to be
considered for matching will be text.charAt(limit-1) in the
forward direction or text.charAt(limit+1) in the backward
direction. limit, boolean if true, then assume further characters may
be inserted at limit and check for partial matching. Otherwise
assume the text as given is complete. incremental)Implements com. |
| public boolean | matchesIndexValue(int v)
Implements com. |
| public int | replace(Replaceable
the text to be matched text, int inclusive start index of text to be replaced start, int exclusive end index of text to be replaced;
must be greater than or equal to start limit, int[] output parameter for the cursor position.
Not all replacer objects will update this, but in a complete
tree of replacer objects, representing the entire output side
of a transliteration rule, at least one must update it. cursor)Implements com. |
| public void | |
| public String | toPattern(boolean
if true then convert unprintable
character to their hex escape representations, \\uxxxx or
\\Uxxxxxxxx. Unprintable characters are those other than
U+000A, U+0020..U+007E. escapeUnprintable)Implements com. |
| public String | toReplacerPattern(boolean
if true then convert unprintable
character to their hex escape representations, \\uxxxx or
\\Uxxxxxxxx. Unprintable characters are defined by
Utility.isUnprintable(). escapeUnprintable)Implements com. |
| data | back to summary |
|---|---|
| private final RuleBasedTransliterator. Context object that maps stand-ins to matcher and replacer objects. | |
| matchLimit | back to summary |
|---|---|
| private int matchLimit Limit offset, in the match text, of the rightmost match. | |
| matchStart | back to summary |
|---|---|
| private int matchStart Start offset, in the match text, of the rightmost match. | |
| pattern | back to summary |
|---|---|
| private String pattern The text to be matched. | |
| segmentNumber | back to summary |
|---|---|
| private int segmentNumber The segment number, 1-based, or 0 if not a segment. | |
| StringMatcher | back to summary |
|---|---|
| public StringMatcher(String theString, int segmentNum, RuleBasedTransliterator. Construct a matcher that matches the given pattern string.
| |
| StringMatcher | back to summary |
|---|---|
| public StringMatcher(String theString, int start, int limit, int segmentNum, RuleBasedTransliterator. Construct a matcher that matches a substring of the given pattern string.
| |
| addMatchSetTo | back to summary |
|---|---|
| public void addMatchSetTo(UnicodeSet toUnionTo) Implements com. Implementation of UnicodeMatcher API. Union the set of all characters that may be matched by this object into the given set.
| |
| addReplacementSetTo | back to summary |
|---|---|
| public void addReplacementSetTo(UnicodeSet toUnionTo) Implements com. Union the set of all characters that may output by this object into the given set.
| |
| matches | back to summary |
|---|---|
| public int matches(Replaceable text, int[] offset, int limit, boolean incremental) Implements com. Implement UnicodeMatcher
| |
| matchesIndexValue | back to summary |
|---|---|
| public boolean matchesIndexValue(int v) Implements com. Implement UnicodeMatcher
| |
| replace | back to summary |
|---|---|
| public int replace(Replaceable text, int start, int limit, int[] cursor) Implements com. UnicodeReplacer API
| |
| resetMatch | back to summary |
|---|---|
| public void resetMatch() Remove any match data. This must be called before performing a set of matches with this segment. | |
| toPattern | back to summary |
|---|---|
| public String toPattern(boolean escapeUnprintable) Implements com. Implement UnicodeMatcher
| |
| toReplacerPattern | back to summary |
|---|---|
| public String toReplacerPattern(boolean escapeUnprintable) Implements com. UnicodeReplacer API
| |