Top Description Constructors Methods
com.ibm.icu.text

public abstract Class UnicodeFilter

extends Object
implements UnicodeMatcher
Class Inheritance
All Implemented Interfaces
com.ibm.icu.text.UnicodeMatcher
Known Direct Subclasses
com.ibm.icu.text.UnicodeSet
Annotations
@SuppressWarnings:javadoc

UnicodeFilter defines 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 like com.ibm.icu.text.Transliterator to only process selected characters through a transformation.
ICU Status
Stable since ICU 2.0.

Constructor Summary

AccessConstructor and Description
protected
UnicodeFilter()

Deprecated This API is ICU internal only.
(This should not be here; it is declared to make CheckTags happy.

Method Summary

Modifier and TypeMethod and Description
public abstract boolean
contains(int c)

Returns true for characters that are in the selected subset.

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.ibm.icu.text.UnicodeMatcher.matches.

Default implementation of UnicodeMatcher::matches() for Unicode filters.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

UnicodeFilterback to summary
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.)

Annotations
@Deprecated
ICU Status
Internal ICU component.

Method Detail

containsback to summary
public abstract boolean contains(int c)

Returns true for characters that are in the selected subset. In other words, if a character is to be filtered, then contains() returns false.

ICU Status
Stable since ICU 2.0.
matchesback to summary
public int matches(Replaceable text, int[] offset, int limit, boolean incremental)

Implements com.ibm.icu.text.UnicodeMatcher.matches.

Default implementation of UnicodeMatcher::matches() for Unicode filters. Matches a single 16-bit code unit at offset.

Parameters
text:Replaceable

Doc from com.ibm.icu.text.UnicodeMatcher.matches.

the text to be matched

offset:int[]

Doc from com.ibm.icu.text.UnicodeMatcher.matches.

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:int

Doc from com.ibm.icu.text.UnicodeMatcher.matches.

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:boolean

Doc from com.ibm.icu.text.UnicodeMatcher.matches.

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:int

Doc from com.ibm.icu.text.UnicodeMatcher.matches.

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.

Annotations
@Override
ICU Status
Stable since ICU 2.0.