Package com.ibm.icu.text
Enum UnicodeSetSpanner.CountMethod
- java.lang.Object
-
- java.lang.Enum<UnicodeSetSpanner.CountMethod>
-
- com.ibm.icu.text.UnicodeSetSpanner.CountMethod
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<UnicodeSetSpanner.CountMethod>
- Enclosing class:
- UnicodeSetSpanner
public static enum UnicodeSetSpanner.CountMethod extends java.lang.Enum<UnicodeSetSpanner.CountMethod>
Options for replaceFrom and countIn to control how to treat each matched span. It is similar to whether one is replacing [abc] by x, or [abc]* by x.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description MIN_ELEMENTS
Use the smallest number of elements in the spanned range for counting and modification, based on theUnicodeSet.SpanCondition
.WHOLE_SPAN
Collapse spans.
-
Constructor Summary
Constructors Modifier Constructor Description private
CountMethod()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static UnicodeSetSpanner.CountMethod
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static UnicodeSetSpanner.CountMethod[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
WHOLE_SPAN
public static final UnicodeSetSpanner.CountMethod WHOLE_SPAN
Collapse spans. That is, modify/count the entire matching span as a single item, instead of separate set elements.
-
MIN_ELEMENTS
public static final UnicodeSetSpanner.CountMethod MIN_ELEMENTS
Use the smallest number of elements in the spanned range for counting and modification, based on theUnicodeSet.SpanCondition
. If the set has no strings, this will be the same as the number of spanned code points.For example, in the string "abab" with SpanCondition.SIMPLE:
- spanning with [ab] will count four MIN_ELEMENTS.
- spanning with [{ab}] will count two MIN_ELEMENTS.
- spanning with [ab{ab}] will also count two MIN_ELEMENTS.
-
-
Method Detail
-
values
public static UnicodeSetSpanner.CountMethod[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (UnicodeSetSpanner.CountMethod c : UnicodeSetSpanner.CountMethod.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static UnicodeSetSpanner.CountMethod valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-