From 84e315c464ddeb3319af43be89ab965989eba991 Mon Sep 17 00:00:00 2001 From: Mihai Nita Date: Fri, 2 Aug 2024 10:58:52 -0700 Subject: [PATCH] ICU-22845 Better iterations for the ICU4J UnicodeSet --- .../java/com/ibm/icu/text/UnicodeSet.java | 204 +++++++++++++++++- .../ibm/icu/dev/test/lang/UnicodeSetTest.java | 181 ++++++++++++++++ 2 files changed, 378 insertions(+), 7 deletions(-) diff --git a/icu4j/main/core/src/main/java/com/ibm/icu/text/UnicodeSet.java b/icu4j/main/core/src/main/java/com/ibm/icu/text/UnicodeSet.java index cc97bbc840b9..adb038adef11 100644 --- a/icu4j/main/core/src/main/java/com/ibm/icu/text/UnicodeSet.java +++ b/icu4j/main/core/src/main/java/com/ibm/icu/text/UnicodeSet.java @@ -17,7 +17,12 @@ import java.util.Iterator; import java.util.NoSuchElementException; import java.util.SortedSet; +import java.util.Spliterator; import java.util.TreeSet; +import java.util.function.IntConsumer; +import java.util.stream.IntStream; +import java.util.stream.Stream; +import java.util.stream.StreamSupport; import com.ibm.icu.impl.BMPSet; import com.ibm.icu.impl.CharacterPropertiesImpl; @@ -278,14 +283,25 @@ * * * - *

To iterate over contents of UnicodeSet, the following are available: - *