Serializable, Comparable<UnicodeSet.SpanCondition>public static enum UnicodeSet.SpanCondition extends Enum<UnicodeSet.SpanCondition>
The functionality is straightforward for sets with only single code points, without strings (which is the common case):
Note: Unpaired surrogates are treated like surrogate code points. Similarly, set strings match only on code point boundaries, never in the middle of a surrogate pair.
| 枚举常量 | 说明 |
|---|---|
CONDITION_COUNT |
One more than the last span condition.
|
CONTAINED |
Spans the longest substring that is a concatenation of set elements (characters or strings).
|
NOT_CONTAINED |
Continues a span() while there is no set element at the current position.
|
SIMPLE |
Continues a span() while there is a set element at the current position.
|
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
static UnicodeSet.SpanCondition |
valueOf(String name) |
返回带有指定名称的该类型的枚举常量。
字符串必须与用于声明该类型的枚举常量的
标识符完全匹配。(不允许有多余
的空格字符。)
|
static UnicodeSet.SpanCondition[] |
values() |
按照声明该枚举类型的常量的顺序, 返回
包含这些常量的数组。该方法可用于迭代
常量, 如下所示:
for (UnicodeSet.SpanCondition c : UnicodeSet.SpanCondition.values()) System.out.println(c); |
public static final UnicodeSet.SpanCondition NOT_CONTAINED
When span() returns, the substring between where it started and the position it returned consists only of characters that are not in the set, and none of its strings overlap with the span.
public static final UnicodeSet.SpanCondition CONTAINED
When span() returns, the substring between where it started and the position it returned consists only of set elements (characters or strings) that are in the set.
If a set contains strings, then the span will be the longest substring for which there
exists at least one non-overlapping concatenation of set elements (characters or strings).
This is equivalent to a POSIX regular expression for (OR of each set element)*.
(Java/ICU/Perl regex stops at the first match of an OR.)
public static final UnicodeSet.SpanCondition SIMPLE
When span() returns, the substring between where it started and the position it returned consists only of set elements (characters or strings) that are in the set.
If a set only contains single characters, then this is the same as CONTAINED.
If a set contains strings, then the span will be the longest substring with a match at each position with the longest single set element (character or string).
Use this span condition together with other longest-match algorithms, such as ICU converters (ucnv_getUnicodeSet()).
public static final UnicodeSet.SpanCondition CONDITION_COUNT
public static UnicodeSet.SpanCondition[] values()
for (UnicodeSet.SpanCondition c : UnicodeSet.SpanCondition.values()) System.out.println(c);
public static UnicodeSet.SpanCondition valueOf(String name)
name - 要返回的枚举常量的名称。IllegalArgumentException - 如果该枚举类型没有带有指定名称的常量NullPointerException - 如果参数为空值