Enum UnicodeSetSpanner.CountMethod

java.lang.Object
java.lang.Enum<UnicodeSetSpanner.CountMethod>
com.ibm.icu.text.UnicodeSetSpanner.CountMethod
All Implemented Interfaces:
Serializable, Comparable<UnicodeSetSpanner.CountMethod>, java.lang.constant.Constable
Enclosing class:
UnicodeSetSpanner

public static enum UnicodeSetSpanner.CountMethod extends 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 Details

    • 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 the UnicodeSet.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 Details

    • values

      public static UnicodeSetSpanner.CountMethod[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static UnicodeSetSpanner.CountMethod valueOf(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:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null