From 9cd4ea6f2028b6f96d4321d67948c5649a6e6a93 Mon Sep 17 00:00:00 2001 From: Dzmitry Marudau Date: Thu, 3 Dec 2020 18:45:58 +0300 Subject: [PATCH 1/6] Apply consistent formatting for changes --- wiki/CHANGES.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wiki/CHANGES.md b/wiki/CHANGES.md index ab823dfb..00230e7a 100644 --- a/wiki/CHANGES.md +++ b/wiki/CHANGES.md @@ -3,22 +3,22 @@ Check also [MIGRATION.md](MIGRATION.md) for possible compatibility problems. ### 0.7.3 -* [#028] Added: `StreamEx.toCollectionAndThen` +* [#028] Added: `StreamEx.toCollectionAndThen`. * [#039] Added: `AbstractStreamEx.reducingWithZero` and `MoreCollectors.reducingWithZero`. * [#043] Added: Add `MoreCollectors.entriesToMap` and `MoreCollectors.entriesToCustomMap` methods accepting Entry. +* [#091] Move API tests to the separate package. * [#093] Optimized: parallel performance of unordered primitive streams and for short-circuiting streams is improved. * [#219] Changed: MoreCollectors now reject eagerly null parameters where possible; `MoreCollectors.last` throws NPE if last stream element is null. -* [#221] Fixed: `rangeClosed(x, x, step)` returned empty stream instead of stream of `x` if step absolute value is - bigger than one. +* [#221] Fixed: `rangeClosed(x, x, step)` returned empty stream instead of stream of `x` if step absolute value is bigger than one. * [#226] Added: `EntryStream.pairMap` (pairMap pulled up to AbstractStreamEx). * [#229] Fixed: Some non-canonical nans were sorted incorrectly with `Double.reverseSorted()`. ### 0.7.2 -* Fixed: accidental use of Java 9 API in CrossSpliterator +* Fixed: accidental use of Java 9 API in CrossSpliterator. ### 0.7.1 -* [#202] Fixed: `StreamEx/EntryStream.ofTree` stack consumption is now limited -* Multi-release Jar is used to provide Java 9+ specializations +* [#202] Fixed: `StreamEx/EntryStream.ofTree` stack consumption is now limited. +* Multi-release Jar is used to provide Java 9+ specializations. ### 0.7.0 * [#193] Removed optimizations which rely on internal implementation details of Stream API (unwrap IteratorSpliterator; From efb2e1ac9f337def1c9fc0eaaf5eb1811c336d34 Mon Sep 17 00:00:00 2001 From: Dzmitry Marudau Date: Thu, 3 Dec 2020 18:45:58 +0300 Subject: [PATCH 2/6] Apply consistent formatting for changes --- wiki/CHANGES.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wiki/CHANGES.md b/wiki/CHANGES.md index 00230e7a..d051ee40 100644 --- a/wiki/CHANGES.md +++ b/wiki/CHANGES.md @@ -5,13 +5,13 @@ Check also [MIGRATION.md](MIGRATION.md) for possible compatibility problems. ### 0.7.3 * [#028] Added: `StreamEx.toCollectionAndThen`. * [#039] Added: `AbstractStreamEx.reducingWithZero` and `MoreCollectors.reducingWithZero`. -* [#043] Added: Add `MoreCollectors.entriesToMap` and `MoreCollectors.entriesToCustomMap` methods accepting Entry. +* [#043] Added: `MoreCollectors.entriesToMap` and `MoreCollectors.entriesToCustomMap` methods accepting Entry. * [#091] Move API tests to the separate package. * [#093] Optimized: parallel performance of unordered primitive streams and for short-circuiting streams is improved. * [#219] Changed: MoreCollectors now reject eagerly null parameters where possible; `MoreCollectors.last` throws NPE if last stream element is null. * [#221] Fixed: `rangeClosed(x, x, step)` returned empty stream instead of stream of `x` if step absolute value is bigger than one. * [#226] Added: `EntryStream.pairMap` (pairMap pulled up to AbstractStreamEx). -* [#229] Fixed: Some non-canonical nans were sorted incorrectly with `Double.reverseSorted()`. +* [#229] Fixed: some non-canonical nans were sorted incorrectly with `Double.reverseSorted()`. ### 0.7.2 * Fixed: accidental use of Java 9 API in CrossSpliterator. From 98b669452d33d558ff1fe5d801d8bc9b9c0d28c7 Mon Sep 17 00:00:00 2001 From: Dzmitry Marudau Date: Thu, 3 Dec 2020 19:59:48 +0300 Subject: [PATCH 3/6] Extend EntryStream with `withoutKey`, `withoutKeys`, `withoutValue` and `withoutValues` methods --- .../java/one/util/streamex/EntryStream.java | 85 +++++++++++++++++++ .../one/util/streamex/EntryStreamTest.java | 59 +++++++++++++ wiki/CHANGES.md | 3 + 3 files changed, 147 insertions(+) diff --git a/src/main/java/one/util/streamex/EntryStream.java b/src/main/java/one/util/streamex/EntryStream.java index 7f4e408a..50d44398 100644 --- a/src/main/java/one/util/streamex/EntryStream.java +++ b/src/main/java/one/util/streamex/EntryStream.java @@ -41,6 +41,7 @@ import java.util.function.BinaryOperator; import java.util.function.Consumer; import java.util.function.Function; +import java.util.function.IntPredicate; import java.util.function.Predicate; import java.util.function.Supplier; import java.util.stream.Collector; @@ -2284,4 +2285,88 @@ public static EntryStream generate(Supplier keySupplie Stream.generate(() -> new SimpleImmutableEntry<>(keySupplier.get(), valueSupplier.get())), StreamContext.SEQUENTIAL); } + + /** + * Returns a {@code EntryStream} consisting of the elements of this stream those keys are not equal to given keys. + * + *

+ * This is an intermediate operation. + * + * @return the new stream containing only the values + * @see #withoutKey(Object) + * @see #withoutValue(Object) + * @see #withoutValues(Object...) + * @since 0.7.4 + */ + public EntryStream withoutKeys(K... keys) { + if (keys.length == 0) + return this; + if (keys.length == 1) + return withoutKey(keys[0]); + return filter(entry -> { + for (K key : keys) { + if (entry.getKey().equals(key)) + return false; + } + return true; + }); + } + + /** + * Returns a {@code EntryStream} consisting of the elements of this stream those keys are not equal given key. + * + *

+ * This is an intermediate operation. + * + * @return the new stream containing only the values + * @see #withoutKeys(Object...) + * @see #withoutValue(Object) + * @see #withoutValues(Object...) + * @since 0.7.4 + */ + public EntryStream withoutKey(K key) { + return filter(entry -> !entry.getKey().equals(key)); + } + + /** + * Returns a {@code EntryStream} consisting of the elements of this stream those keys are not equal to given keys. + * + *

+ * This is an intermediate operation. + * + * @return the new stream containing only the values + * @see #withoutKey(Object) + * @see #withoutKeys(Object...) + * @see #withoutValue(Object) + * @since 0.7.4 + */ + public EntryStream withoutValues(V... values) { + if (values.length == 0) + return this; + if (values.length == 1) + return withoutValue(values[0]); + return filter(entry -> { + for (V value : values) { + if (entry.getValue().equals(value)) + return false; + } + return true; + }); + } + + /** + * Returns a {@code EntryStream} consisting of the elements of this stream those keys are not equal given key. + * + *

+ * This is an intermediate operation. + * + * @return the new stream containing only the values + * @see #withoutKey(Object) + * @see #withoutKeys(Object...) + * @see #withoutValues(Object...) + * @since 0.7.4 + */ + public EntryStream withoutValue(V value) { + return filter(entry -> !entry.getValue().equals(value)); + } } diff --git a/src/test/java/one/util/streamex/EntryStreamTest.java b/src/test/java/one/util/streamex/EntryStreamTest.java index 80e33644..2bdaa75a 100644 --- a/src/test/java/one/util/streamex/EntryStreamTest.java +++ b/src/test/java/one/util/streamex/EntryStreamTest.java @@ -814,4 +814,63 @@ public void testPrefixValues() { Map map = EntryStream.of("a", 1, "b", 2, "c", 3, "d", 4).prefixKeys(String::concat).toMap(); assertEquals(EntryStream.of("a", 1, "ab", 2, "abc", 3, "abcd", 4).toMap(), map); } + + @Test + public void testWithoutKey() { + entryStream(() -> EntryStream.of(1, "a", 1, "b", 2, "c", 3, "d", 1, "e", 1, "f", 1, "g"), + s -> checkAsString("2->c;3->d", s.get().withoutKey(1))); + + assertEquals(EntryStream.of("b", 2, "d", 4).toMap(), + EntryStream.of("a", 1, "b", 2, "c", 3, "d", 4) + .withoutKey("a").withoutKey("c").toMap()); + + assertEquals(EntryStream.of("a", 1, "B", 4).toMap(), + EntryStream.of("a", 1, "A", 2, "b", 3, "B", 4) + .withoutKey("A").withoutKey("b").toMap()); + + entryStream(() -> EntryStream.generate(() -> "a", () -> 1).limit(10), + s -> checkAsString("", s.get().withoutKey("a"))); + } + + @Test + public void testWithoutKeys() { + entryStream(() -> EntryStream.of(1, "a", 1, "b", 2, "c", 3, "d", 4, "e", 4, "f", 1, "g"), + s -> checkAsString("2->c;3->d", s.get().withoutKeys(1, 4))); + assertEquals(EntryStream.of("b", 2, "d", 4).toMap(), + EntryStream.of("a", 1, "b", 2, "c", 3, "d", 4) + .withoutKeys("a", "c").toMap()); + assertEquals("Stream is not chengd", + EntryStream.of("a", 1, "b", 2, "c", 3, "d", 4, "e", 5).toMap(), + EntryStream.of("a", 1, "b", 2, "c", 3, "d", 4, "e", 5).withoutKeys().toMap()); + } + + @Test + public void testWithoutValue() { + entryStream(() -> EntryStream.of(1, "a", 1, "b", 2, "b", 3, "c", 4, "c", 5, "c", 6, "d"), + s -> checkAsString("1->a;1->b;2->b;6->d", s.get().withoutValue("c"))); + + assertEquals(EntryStream.of("c", 3, "d", 4).toMap(), + EntryStream.of("a", 1, "b", 2, "c", 3, "d", 4) + .withoutValue(1).withoutValue(2).toMap()); + + entryStream(() -> EntryStream.generate(() -> "a", () -> 1).limit(10), + s -> checkAsString("", s.get().withoutValue(1))); + } + + @Test + public void testWithoutValues() { + entryStream(() -> EntryStream.of(1, "a", 1, "b", 2, "b", 3, "c", 4, "c", 5, "c", 6, "d"), + s -> checkAsString("1->a;6->d", s.get().withoutValues("b", "c"))); + entryStream(() -> EntryStream.of(1, "a", 1, "A", 2, "b", 3, "B", 4, "c", 5, "C"), + s -> checkAsString("1->A;2->b;4->c;5->C", s.get().withoutValues("a", "B"))); + + assertEquals(EntryStream.of("c", 3, "d", 4).toMap(), + EntryStream.of("a", 1, "b", 2, "c", 3, "d", 4) + .withoutValues(1, 2).toMap()); + + assertEquals("Stream is not chengd", + EntryStream.of("a", 1, "b", 2, "c", 3, "d", 4, "e", 5).toMap(), + EntryStream.of("a", 1, "b", 2, "c", 3, "d", 4, "e", 5).withoutValues().toMap()); + + } } diff --git a/wiki/CHANGES.md b/wiki/CHANGES.md index d051ee40..87369b44 100644 --- a/wiki/CHANGES.md +++ b/wiki/CHANGES.md @@ -2,6 +2,9 @@ Check also [MIGRATION.md](MIGRATION.md) for possible compatibility problems. +### 0.7.4 +* [#185] Added: `EntryStream.withoutKeys()` and `EntryStream.withoutValues()`. + ### 0.7.3 * [#028] Added: `StreamEx.toCollectionAndThen`. * [#039] Added: `AbstractStreamEx.reducingWithZero` and `MoreCollectors.reducingWithZero`. From 56aaa8633d76788553d6be982a273fc83b9a539a Mon Sep 17 00:00:00 2001 From: Dzmitry Marudau Date: Fri, 4 Dec 2020 18:36:47 +0300 Subject: [PATCH 4/6] Extend EntryStream with `withoutKey`, `withoutKeys`, `withoutValue` and `withoutValues` methods --- wiki/CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wiki/CHANGES.md b/wiki/CHANGES.md index 87369b44..526109f6 100644 --- a/wiki/CHANGES.md +++ b/wiki/CHANGES.md @@ -3,7 +3,7 @@ Check also [MIGRATION.md](MIGRATION.md) for possible compatibility problems. ### 0.7.4 -* [#185] Added: `EntryStream.withoutKeys()` and `EntryStream.withoutValues()`. +* [#185] Added: `EntryStream.withoutKey`, `EntryStream.withoutKeys`, `EntryStream.withoutValue` and `EntryStream.withoutValues`. ### 0.7.3 * [#028] Added: `StreamEx.toCollectionAndThen`. From a0f1a2c66a16998a76d3217edb009088b305e8dc Mon Sep 17 00:00:00 2001 From: Dzmitry Marudau Date: Sat, 9 Jan 2021 00:38:53 +0300 Subject: [PATCH 5/6] Implement code review points --- .../java/one/util/streamex/EntryStream.java | 71 +++++++++---------- .../util/streamex/api/EntryStreamTest.java | 49 +++++++------ wiki/CHEATSHEET.md | 2 + 3 files changed, 62 insertions(+), 60 deletions(-) diff --git a/src/main/java/one/util/streamex/EntryStream.java b/src/main/java/one/util/streamex/EntryStream.java index 50d44398..a56ff62a 100644 --- a/src/main/java/one/util/streamex/EntryStream.java +++ b/src/main/java/one/util/streamex/EntryStream.java @@ -2287,14 +2287,27 @@ public static EntryStream generate(Supplier keySupplie } /** - * Returns a {@code EntryStream} consisting of the elements of this stream those keys are not equal to given keys. + * Returns an {@code EntryStream} consisting of the elements of this stream + * whose keys are not equal to any of supplied keys. * *

* This is an intermediate operation. + * May return itself if no keys were supplied. * - * @return the new stream containing only the values - * @see #withoutKey(Object) - * @see #withoutValue(Object) + *

+ * Current implementation scans the supplied keys linearly for every stream element. + * If you have many keys, consider using more efficient alternative instead. + * + *

+ * Future implementations may take advantage on using {@code hashCode()} or + * {@code compareTo} for {@code Comparable} objects to improve the performance. + * + *

+ * If the {@code keys} array is changed between calling this method and finishing the stream traversal, + * then the result of the stream traversal is undefined: changes may or may not be taken into account. + * + * @param keys the keys to remove from the stream. + * @return the new stream * @see #withoutValues(Object...) * @since 0.7.4 */ @@ -2302,7 +2315,7 @@ public EntryStream withoutKeys(K... keys) { if (keys.length == 0) return this; if (keys.length == 1) - return withoutKey(keys[0]); + return filter(entry -> !entry.getKey().equals(keys[0])); return filter(entry -> { for (K key : keys) { if (entry.getKey().equals(key)) @@ -2313,38 +2326,35 @@ public EntryStream withoutKeys(K... keys) { } /** - * Returns a {@code EntryStream} consisting of the elements of this stream those keys are not equal given key. + * Returns an {@code EntryStream} consisting of the elements of this stream + * whose values are not equal to any of the supplied values. * *

* This is an intermediate operation. + * May return itself if no values were supplied. * - * @return the new stream containing only the values - * @see #withoutKeys(Object...) - * @see #withoutValue(Object) - * @see #withoutValues(Object...) - * @since 0.7.4 - */ - public EntryStream withoutKey(K key) { - return filter(entry -> !entry.getKey().equals(key)); - } - - /** - * Returns a {@code EntryStream} consisting of the elements of this stream those keys are not equal to given keys. + *

+ * Current implementation scans the supplied values linearly for every stream element. + * If you have many values, consider using more efficient alternative instead. * *

- * This is an intermediate operation. + * Future implementations may take advantage on using {@code hashCode()} or + * {@code compareTo} for {@code Comparable} objects to improve the performance. + * + *

+ * If the {@code values} array is changed between calling this method and finishing the stream traversal, + * then the result of the stream traversal is undefined: changes may or may not be taken into account. * - * @return the new stream containing only the values - * @see #withoutKey(Object) + * @param values the values to remove from the stream. + * @return the new stream * @see #withoutKeys(Object...) - * @see #withoutValue(Object) * @since 0.7.4 */ public EntryStream withoutValues(V... values) { if (values.length == 0) return this; if (values.length == 1) - return withoutValue(values[0]); + return filter(entry -> !entry.getValue().equals(values[0])); return filter(entry -> { for (V value : values) { if (entry.getValue().equals(value)) @@ -2354,19 +2364,4 @@ public EntryStream withoutValues(V... values) { }); } - /** - * Returns a {@code EntryStream} consisting of the elements of this stream those keys are not equal given key. - * - *

- * This is an intermediate operation. - * - * @return the new stream containing only the values - * @see #withoutKey(Object) - * @see #withoutKeys(Object...) - * @see #withoutValues(Object...) - * @since 0.7.4 - */ - public EntryStream withoutValue(V value) { - return filter(entry -> !entry.getValue().equals(value)); - } } diff --git a/src/test/java/one/util/streamex/api/EntryStreamTest.java b/src/test/java/one/util/streamex/api/EntryStreamTest.java index dd237bdb..9ee88dcd 100644 --- a/src/test/java/one/util/streamex/api/EntryStreamTest.java +++ b/src/test/java/one/util/streamex/api/EntryStreamTest.java @@ -816,49 +816,58 @@ public void testPrefixValues() { } @Test - public void testWithoutKey() { + public void testWithoutKeys() { + assertEquals("Stream is not changed", + EntryStream.of("a", 1, "b", 2, "c", 3, "d", 4).toMap(), + EntryStream.of("a", 1, "b", 2, "c", 3, "d", 4) + .withoutKeys().withoutKeys().withoutKeys().toMap()); + + assertEquals(EntryStream.of("a", 1, "b", 2, "c", 3, "d", 4).toMap(), + EntryStream.of("a", 1, "b", 2, "c", 3, "d", 4) + .withoutKeys().withoutKeys("A").withoutKeys("B", "C","D").toMap()); + entryStream(() -> EntryStream.of(1, "a", 1, "b", 2, "c", 3, "d", 1, "e", 1, "f", 1, "g"), - s -> checkAsString("2->c;3->d", s.get().withoutKey(1))); + s -> checkAsString("2->c;3->d", s.get().withoutKeys(1))); assertEquals(EntryStream.of("b", 2, "d", 4).toMap(), EntryStream.of("a", 1, "b", 2, "c", 3, "d", 4) - .withoutKey("a").withoutKey("c").toMap()); + .withoutKeys("a").withoutKeys("c").toMap()); assertEquals(EntryStream.of("a", 1, "B", 4).toMap(), EntryStream.of("a", 1, "A", 2, "b", 3, "B", 4) - .withoutKey("A").withoutKey("b").toMap()); + .withoutKeys("A").withoutKeys("b").toMap()); entryStream(() -> EntryStream.generate(() -> "a", () -> 1).limit(10), - s -> checkAsString("", s.get().withoutKey("a"))); - } + s -> checkAsString("", s.get().withoutKeys("a"))); - @Test - public void testWithoutKeys() { entryStream(() -> EntryStream.of(1, "a", 1, "b", 2, "c", 3, "d", 4, "e", 4, "f", 1, "g"), s -> checkAsString("2->c;3->d", s.get().withoutKeys(1, 4))); assertEquals(EntryStream.of("b", 2, "d", 4).toMap(), EntryStream.of("a", 1, "b", 2, "c", 3, "d", 4) .withoutKeys("a", "c").toMap()); - assertEquals("Stream is not chengd", - EntryStream.of("a", 1, "b", 2, "c", 3, "d", 4, "e", 5).toMap(), - EntryStream.of("a", 1, "b", 2, "c", 3, "d", 4, "e", 5).withoutKeys().toMap()); } @Test - public void testWithoutValue() { + public void testWithoutValues() { + assertEquals("Stream is not changed", + EntryStream.of("a", 1, "b", 2, "c", 3, "d", 4).toMap(), + EntryStream.of("a", 1, "b", 2, "c", 3, "d", 4) + .withoutValues().withoutValues().withoutValues().toMap()); + + assertEquals(EntryStream.of("a", 1, "b", 2, "c", 3, "d", 4).toMap(), + EntryStream.of("a", 1, "b", 2, "c", 3, "d", 4) + .withoutValues().withoutValues(6).withoutValues(7, 8).toMap()); + entryStream(() -> EntryStream.of(1, "a", 1, "b", 2, "b", 3, "c", 4, "c", 5, "c", 6, "d"), - s -> checkAsString("1->a;1->b;2->b;6->d", s.get().withoutValue("c"))); + s -> checkAsString("1->a;1->b;2->b;6->d", s.get().withoutValues("c"))); assertEquals(EntryStream.of("c", 3, "d", 4).toMap(), EntryStream.of("a", 1, "b", 2, "c", 3, "d", 4) - .withoutValue(1).withoutValue(2).toMap()); + .withoutValues(1).withoutValues(2).toMap()); entryStream(() -> EntryStream.generate(() -> "a", () -> 1).limit(10), - s -> checkAsString("", s.get().withoutValue(1))); - } + s -> checkAsString("", s.get().withoutValues(1))); - @Test - public void testWithoutValues() { entryStream(() -> EntryStream.of(1, "a", 1, "b", 2, "b", 3, "c", 4, "c", 5, "c", 6, "d"), s -> checkAsString("1->a;6->d", s.get().withoutValues("b", "c"))); entryStream(() -> EntryStream.of(1, "a", 1, "A", 2, "b", 3, "B", 4, "c", 5, "C"), @@ -868,9 +877,5 @@ public void testWithoutValues() { EntryStream.of("a", 1, "b", 2, "c", 3, "d", 4) .withoutValues(1, 2).toMap()); - assertEquals("Stream is not chengd", - EntryStream.of("a", 1, "b", 2, "c", 3, "d", 4, "e", 5).toMap(), - EntryStream.of("a", 1, "b", 2, "c", 3, "d", 4, "e", 5).withoutValues().toMap()); - } } diff --git a/wiki/CHEATSHEET.md b/wiki/CHEATSHEET.md index 0da9d21c..55f4fc3f 100644 --- a/wiki/CHEATSHEET.md +++ b/wiki/CHEATSHEET.md @@ -84,6 +84,8 @@ What I want | How to get it --- | --- Remove nulls | `StreamEx/EntryStream.nonNull()` Remove entries which keys or values are null | `EntryStream.nonNullKeys()/nonNullValues()` +Remove entries which keys are equal to any of the supplied keys | `EntryStream.withoutKeys()` +Remove entries which values are equal to any of the supplied values | `EntryStream.withoutValues()` Remove elements by predicate | `any.remove()` Remove given elements | `StreamEx/IntStreamEx/LongStreamEx.without()` Remove by value extracted by supplied mapper function | `StreamEx.removeBy()` From a1531bb03692e98744b2ba7bf118694bc8a4ee0a Mon Sep 17 00:00:00 2001 From: Dzmitry Marudau Date: Sat, 9 Jan 2021 15:22:59 +0300 Subject: [PATCH 6/6] Implement code review points --- src/main/java/one/util/streamex/EntryStream.java | 6 ++++-- wiki/CHANGES.md | 2 +- wiki/CHEATSHEET.md | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/one/util/streamex/EntryStream.java b/src/main/java/one/util/streamex/EntryStream.java index a56ff62a..2640f9d1 100644 --- a/src/main/java/one/util/streamex/EntryStream.java +++ b/src/main/java/one/util/streamex/EntryStream.java @@ -2308,8 +2308,9 @@ public static EntryStream generate(Supplier keySupplie * * @param keys the keys to remove from the stream. * @return the new stream - * @see #withoutValues(Object...) * @since 0.7.4 + * @see #withoutValues(Object...) + * @see StreamEx#without(Object...) */ public EntryStream withoutKeys(K... keys) { if (keys.length == 0) @@ -2347,8 +2348,9 @@ public EntryStream withoutKeys(K... keys) { * * @param values the values to remove from the stream. * @return the new stream - * @see #withoutKeys(Object...) * @since 0.7.4 + * @see #withoutKeys(Object...) + * @see StreamEx#without(Object...) */ public EntryStream withoutValues(V... values) { if (values.length == 0) diff --git a/wiki/CHANGES.md b/wiki/CHANGES.md index 4258dcdb..53098f38 100644 --- a/wiki/CHANGES.md +++ b/wiki/CHANGES.md @@ -4,7 +4,7 @@ Check also [MIGRATION.md](MIGRATION.md) for possible compatibility problems. ### 0.7.4 * [#091] Changed: API tests moved to the separate package. -* [#185] Added: `EntryStream.withoutKey`, `EntryStream.withoutKeys`, `EntryStream.withoutValue` and `EntryStream.withoutValues`. +* [#185] Added: `EntryStream.withoutKeys` and `EntryStream.withoutValues`. ### 0.7.3 * [#028] Added: `StreamEx.toCollectionAndThen`. diff --git a/wiki/CHEATSHEET.md b/wiki/CHEATSHEET.md index 55f4fc3f..26d62549 100644 --- a/wiki/CHEATSHEET.md +++ b/wiki/CHEATSHEET.md @@ -83,9 +83,9 @@ Stream of doubles from the `DoubleBuffer` | `DoubleStreamEx.of(DoubleBuffer)` What I want | How to get it --- | --- Remove nulls | `StreamEx/EntryStream.nonNull()` -Remove entries which keys or values are null | `EntryStream.nonNullKeys()/nonNullValues()` -Remove entries which keys are equal to any of the supplied keys | `EntryStream.withoutKeys()` -Remove entries which values are equal to any of the supplied values | `EntryStream.withoutValues()` +Remove entries whose keys or values are null | `EntryStream.nonNullKeys()/nonNullValues()` +Remove entries whose keys are equal to any of the supplied keys | `EntryStream.withoutKeys()` +Remove entries whose values are equal to any of the supplied values | `EntryStream.withoutValues()` Remove elements by predicate | `any.remove()` Remove given elements | `StreamEx/IntStreamEx/LongStreamEx.without()` Remove by value extracted by supplied mapper function | `StreamEx.removeBy()`