Package com.ibm.icu.text
Class Quantifier
java.lang.Object
com.ibm.icu.text.Quantifier
- All Implemented Interfaces:
UnicodeMatcher
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate UnicodeMatcher
static final int
Maximum count a quantifier can have.private int
private int
Fields inherited from interface com.ibm.icu.text.UnicodeMatcher
ETHER, U_MATCH, U_MISMATCH, U_PARTIAL_MATCH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMatchSetTo
(UnicodeSet toUnionTo) Implementation of UnicodeMatcher API.int
matches
(Replaceable text, int[] offset, int limit, boolean incremental) Implement UnicodeMatcher API.boolean
matchesIndexValue
(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:
matches
in 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:
toPattern
in 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:
matchesIndexValue
in 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:
addMatchSetTo
in interfaceUnicodeMatcher
- Parameters:
toUnionTo
- the set into which to union the source characters
-