Enum 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.
    • 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.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • 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 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.
    • Constructor Detail

      • CountMethod

        private CountMethod()
    • 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 name
        java.lang.NullPointerException - if the argument is null