From b5b3e16afac61f9aa9b775aaf497f8cc88ce9481 Mon Sep 17 00:00:00 2001 From: Mihai Nita Date: Thu, 8 Aug 2024 22:17:31 +0000 Subject: [PATCH] ICU-22845 Better iterations for the ICU4J UnicodeSet --- .../java/com/ibm/icu/text/UnicodeSet.java | 243 +++++++++++++++++- .../ibm/icu/dev/test/lang/UnicodeSetTest.java | 165 +++++++++++- 2 files changed, 400 insertions(+), 8 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..a613f8a4e5cc 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,22 @@ * * * - *

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