Most visited

Recently visited

Added in API level 24

UnicodeFilter

public abstract class UnicodeFilter
extends Object implements UnicodeMatcher

java.lang.Object
   ↳ android.icu.text.UnicodeFilter
Known Direct Subclasses


UnicodeFilter定义了用于选择Unicode字符的全范围(U + 0000到U + FFFF)的子集的协议。

Summary

Inherited constants

From interface android.icu.text.UnicodeMatcher

Public methods

abstract boolean contains(int c)

为选定子集中的字符返回 true

int matches(Replaceable text, int[] offset, int limit, boolean incremental)

Unicode过滤器的UnicodeMatcher :: matches()的默认实现。

Inherited methods

From class java.lang.Object
From interface android.icu.text.UnicodeMatcher

Public methods

contains

Added in API level 24
boolean contains (int c)

为选定子集中的字符返回true 换句话说,如果要过滤一个字符,那么contains()返回false

Parameters
c int
Returns
boolean

matches

Added in API level 24
int matches (Replaceable text, 
                int[] offset, 
                int limit, 
                boolean incremental)

Unicode过滤器的UnicodeMatcher :: matches()的默认实现。 匹配偏移量处的单个16位代码单元。

Parameters
text Replaceable: the text to be matched
offset 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.
limit 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.
incremental 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.
Returns
int 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.

Hooray!