You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2025/04/14 00:40:21 UTC
(groovy) branch master updated: GROOVY-11596: Additional DGM lazy iterator methods (remove two unreleased convenience variants for now pending other discussions)
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/master by this push:
new 8579f0df24 GROOVY-11596: Additional DGM lazy iterator methods (remove two unreleased convenience variants for now pending other discussions)
8579f0df24 is described below
commit 8579f0df2457b5d2dfd99b7f774ec357d6ca5dd3
Author: Paul King <pa...@asert.com.au>
AuthorDate: Mon Apr 14 10:40:13 2025 +1000
GROOVY-11596: Additional DGM lazy iterator methods (remove two unreleased convenience variants for now pending other discussions)
---
.../groovy/runtime/DefaultGroovyMethods.java | 45 ----------------------
1 file changed, 45 deletions(-)
diff --git a/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java b/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
index 259dde9fd4..e300371ea3 100644
--- a/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
+++ b/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
@@ -8416,51 +8416,6 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
return new InterleaveIterator<>(self, other, includeRemainder);
}
- /**
- * An iterator of all the elements from this iterator and the iterable interleaved.
- * If the sources are of different sizes, the result will have twice the
- * size of the shorter one.
- * <p>
- * Example:
- * <pre class="groovyTestCase">
- * def items = (1..4).iterator()
- * def other = [10, 20]
- * assert [1, 10, 2, 20] == items.interleave(other).toList()
- * </pre>
- *
- * @param self an Iterator
- * @param other another Iterator
- * @return an iterator of all the elements from self and other interleaved (until one source is exhausted)
- * @since 5.0.0
- */
- public static <T, U extends T, V extends T> Iterator<T> interleave(Iterator<U> self, Iterable<V> other) {
- return interleave(self, other, false);
- }
-
- /**
- * An iterator of all the elements from this iterator and the iterable interleaved.
- * If the sources are of different sizes, and <code>includeRemainder</code> is true,
- * the extra elements from the longer source will be appended after interleaving.
- * <p>
- * Example:
- * <pre class="groovyTestCase">
- * def items = (1..4).iterator()
- * def other = [10, 20]
- * assert [1, 10, 2, 20, 3, 4] == items.interleave(other, true).toList()
- * </pre>
- * <p>
- * When <code>includeRemainder</code> is false, this is equivalent to <code>zip</code> then <code>collectMany</code>.
- *
- * @param self an Iterator
- * @param other an Iterable
- * @param includeRemainder whether to process extra elements if the operands are of different sizes
- * @return an iterator of all the pairs from self and other
- * @since 5.0.0
- */
- public static <T, U extends T, V extends T> Iterator<T> interleave(Iterator<U> self, Iterable<V> other, boolean includeRemainder) {
- return interleave(self, other.iterator(), includeRemainder);
- }
-
private static final class InterleaveIterator<T, U extends T, V extends T> implements Iterator<T> {
private final Iterator<U> delegate;
private final Iterator<V> other;