Package com.ibm.icu.text
Class UnicodeFilter
- java.lang.Object
-
- com.ibm.icu.text.UnicodeFilter
-
- All Implemented Interfaces:
UnicodeMatcher
- Direct Known Subclasses:
UnicodeSet
public abstract class UnicodeFilter extends Object implements UnicodeMatcher
UnicodeFilterdefines a protocol for selecting a subset of the full range (U+0000 to U+FFFF) of Unicode characters. Currently, filters are used in conjunction with classes likeTransliteratorto only process selected characters through a transformation.- Status:
- Stable ICU 2.0.
-
-
Field Summary
-
Fields inherited from interface com.ibm.icu.text.UnicodeMatcher
ETHER, U_MATCH, U_MISMATCH, U_PARTIAL_MATCH
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedUnicodeFilter()Deprecated.This API is ICU internal only.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract booleancontains(int c)Returnstruefor characters that are in the selected subset.intmatches(Replaceable text, int[] offset, int limit, boolean incremental)Default implementation of UnicodeMatcher::matches() for Unicode filters.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.ibm.icu.text.UnicodeMatcher
addMatchSetTo, matchesIndexValue, toPattern
-
-
-
-
Constructor Detail
-
UnicodeFilter
@Deprecated protected UnicodeFilter()
Deprecated.This API is ICU internal only.(This should not be here; it is declared to make CheckTags happy. Java inserts a synthetic constructor and CheckTags can't tell that it's synthetic.)- Status:
- Internal. This API is ICU internal only.
-
-
Method Detail
-
contains
public abstract boolean contains(int c)
Returnstruefor characters that are in the selected subset. In other words, if a character is to be filtered, thencontains()returnsfalse.- Status:
- Stable ICU 2.0.
-
matches
public int matches(Replaceable text, int[] offset, int limit, boolean incremental)
Default implementation of UnicodeMatcher::matches() for Unicode filters. Matches a single 16-bit code unit at offset.- 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.
- Status:
- Stable ICU 2.0.
-
-