Package com.ibm.icu.text
Class Quantifier
java.lang.Object
com.ibm.icu.text.Quantifier
- All Implemented Interfaces:
UnicodeMatcher
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate UnicodeMatcherstatic final intMaximum count a quantifier can have.private intprivate intFields inherited from interface com.ibm.icu.text.UnicodeMatcher
ETHER, U_MATCH, U_MISMATCH, U_PARTIAL_MATCH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMatchSetTo(UnicodeSet toUnionTo) Implementation of UnicodeMatcher API.intmatches(Replaceable text, int[] offset, int limit, boolean incremental) Implement UnicodeMatcher API.booleanmatchesIndexValue(int v) Implement UnicodeMatcher APItoPattern(boolean escapeUnprintable) Implement UnicodeMatcher API
-
Field Details
-
matcher
-
minCount
private int minCount -
maxCount
private int maxCount -
MAX
public static final int MAXMaximum count a quantifier can have.- See Also:
-
-
Constructor Details
-
Quantifier
-
-
Method Details
-
matches
Implement UnicodeMatcher API.- Specified by:
matchesin interfaceUnicodeMatcher- Parameters:
text- the text to be matchedoffset- 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.limit- 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.incremental- if true, then assume further characters may be inserted at limit and check for partial matching. Otherwise assume the text as given is complete.- Returns:
- a match degree value indicating a full match, a partial match, or a mismatch. If incremental is false then U_PARTIAL_MATCH should never be returned.
-
toPattern
Implement UnicodeMatcher API- Specified by:
toPatternin interfaceUnicodeMatcher- Parameters:
escapeUnprintable- 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.
-
matchesIndexValue
public boolean matchesIndexValue(int v) Implement UnicodeMatcher API- Specified by:
matchesIndexValuein interfaceUnicodeMatcher
-
addMatchSetTo
Implementation of UnicodeMatcher API. Union the set of all characters that may be matched by this object into the given set.- Specified by:
addMatchSetToin interfaceUnicodeMatcher- Parameters:
toUnionTo- the set into which to union the source characters
-