]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/unicode/uset.h
ICU-551.24.tar.gz
[apple/icu.git] / icuSources / common / unicode / uset.h
index 40510cd4167c8f77d50661dfff7fe09b9ef80532..eb3c9e6a06a6f9ff94935ee810e9ca891df60105 100644 (file)
@@ -1,7 +1,7 @@
 /*
 *******************************************************************************
 *
-*   Copyright (C) 2002-2012, International Business Machines
+*   Copyright (C) 2002-2014, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
@@ -98,8 +98,8 @@ enum {
  *
  * The functionality is straightforward for sets with only single code points,
  * without strings (which is the common case):
- * - USET_SPAN_CONTAINED and USET_SPAN_SIMPLE
- *   work the same.
+ * - USET_SPAN_CONTAINED and USET_SPAN_SIMPLE work the same.
+ * - USET_SPAN_CONTAINED and USET_SPAN_SIMPLE are inverses of USET_SPAN_NOT_CONTAINED.
  * - span() and spanBack() partition any string the same way when
  *   alternating between span(USET_SPAN_NOT_CONTAINED) and
  *   span(either "contained" condition).
@@ -149,7 +149,8 @@ enum {
  */
 typedef enum USetSpanCondition {
     /**
-     * Continue a span() while there is no set element at the current position.
+     * Continues a span() while there is no set element at the current position.
+     * Increments by one code point at a time.
      * Stops before the first set element (character or string).
      * (For code points only, this is like while contains(current)==FALSE).
      *
@@ -161,22 +162,23 @@ typedef enum USetSpanCondition {
      */
     USET_SPAN_NOT_CONTAINED = 0,
     /**
-     * Continue a span() while there is a set element at the current position.
+     * Spans the longest substring that is a concatenation of set elements (characters or strings).
      * (For characters only, this is like while contains(current)==TRUE).
      *
      * 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
-     * matching any of the possible concatenations of set elements (characters or strings).
-     * (There must be a single, non-overlapping concatenation of characters or strings.)
-     * This is equivalent to a POSIX regular expression for (OR of each set element)*.
+     * 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 <code>(OR of each set element)*</code>.
+     * (Java/ICU/Perl regex stops at the first match of an OR.)
      *
      * @stable ICU 3.8
      */
     USET_SPAN_CONTAINED = 1,
     /**
-     * Continue a span() while there is a set element at the current position.
+     * Continues a span() while there is a set element at the current position.
+     * Increments by the longest matching element at each position.
      * (For characters only, this is like while contains(current)==TRUE).
      *
      * When span() returns, the substring between where it started and the position