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.
Enum Constant and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
static UnicodeSet.SpanCondition |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static UnicodeSet.SpanCondition[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
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
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright © 2016 Unicode, Inc. and others.