HI Stefan,
On Jun 7, 2015, at 10:07 PM, Stefan Zobel wrote:
> I'm still trying to wrap my head around the test logic for the (par & !ord)
> && (op == WhileOp.Drop) case
> in the whileResultAsserter() method in WhileOpTest.
>
> Wouldn't it be possible that, for an unordered parallel stream, drop
I'm still trying to wrap my head around the test logic for the (par & !ord)
&& (op == WhileOp.Drop) case
in the whileResultAsserter() method in WhileOpTest.
Wouldn't it be possible that, for an unordered parallel stream, dropWhile()
won't drop anything at all (i.e.,
drops an empty set)?
In that c
I think the original version reads better. Remember that the method summary
description contains only the first sentence.
I disagree with the objection about ordering. The stream has some order in
which is "sees" elements. That order may be non-deterministic, but it still
exists, we just don’t
On Jun 6, 2015, at 1:20 AM, Stuart Marks wrote:
> On 6/3/15 9:21 AM, Paul Sandoz wrote:
>> I had prepared an alternative rendition stashed away just in case this came
>> up :-)
>>
>> I still want to retain a punchy short first paragraph. What do you think
>> about the following?
>>
>> /
On 6/3/15 9:21 AM, Paul Sandoz wrote:
I had prepared an alternative rendition stashed away just in case this came up
:-)
I still want to retain a punchy short first paragraph. What do you think about
the following?
/**
- * Returns a stream consisting of the longest prefix of element
On 06/04/2015 10:34 AM, Paul Sandoz wrote:
On Jun 4, 2015, at 10:09 AM, Remi Forax wrote:
On 06/04/2015 09:37 AM, Paul Sandoz wrote:
On Jun 4, 2015, at 9:04 AM, Remi Forax wrote:
Thinking a little more about dropWhile(),
it can be written using filter() more or less like this:
default Str
On Jun 4, 2015, at 10:27 AM, Peter Levart wrote:
>
> On 06/03/2015 08:53 PM, Peter Levart wrote:
>> Hi Paul,
>>
>> This is a usefull addition to Stream API for sequential ordered streams. But
>> does it have any utility in unordered streams at all? Wouldn't it be better
>> to just throw an Ill
On Jun 4, 2015, at 10:09 AM, Remi Forax wrote:
> On 06/04/2015 09:37 AM, Paul Sandoz wrote:
>> On Jun 4, 2015, at 9:04 AM, Remi Forax wrote:
>>> Thinking a little more about dropWhile(),
>>> it can be written using filter() more or less like this:
>>> default Stream dropWhile(Predicate predica
On 06/03/2015 08:53 PM, Peter Levart wrote:
Hi Paul,
This is a usefull addition to Stream API for sequential ordered
streams. But does it have any utility in unordered streams at all?
Wouldn't it be better to just throw an IllegalStateException or
something if the stream is not ordered? I c
On 06/04/2015 09:37 AM, Paul Sandoz wrote:
On Jun 4, 2015, at 9:04 AM, Remi Forax wrote:
Thinking a little more about dropWhile(),
it can be written using filter() more or less like this:
default Stream dropWhile(Predicate predicate) {
return filter(new Predicate<>() {
private boo
On Jun 4, 2015, at 9:04 AM, Remi Forax wrote:
> Thinking a little more about dropWhile(),
> it can be written using filter() more or less like this:
> default Stream dropWhile(Predicate predicate) {
> return filter(new Predicate<>() {
> private boolean noDropAnymore;
> public bool
Thinking a little more about dropWhile(),
it can be written using filter() more or less like this:
default Stream dropWhile(Predicate predicate) {
return filter(new Predicate<>() {
private boolean noDropAnymore;
public boolean test(T t) {
return noDropAnymore || (noDr
Hi Paul,
This is a usefull addition to Stream API for sequential ordered streams.
But does it have any utility in unordered streams at all? Wouldn't it be
better to just throw an IllegalStateException or something if the stream
is not ordered? I can't imagine currently a situation where I woul
Hi Stuart,
I had prepared an alternative rendition stashed away just in case this came up
:-)
I still want to retain a punchy short first paragraph. What do you think about
the following?
Stream skip(long n);
/**
- * Returns a stream consisting of the longest prefix of elements
On Jun 2, 2015, at 8:58 PM, Chris Hegarty wrote:
> Very nice. I just looked over the spec, for now.
>
> * @param predicate a href="package-summary.html#NonInterference">non-interfering,
> * href="package-summary.html#Statelessness">stateless
> *
Hi Paul,
Some comments on the spec.
On 6/2/15 6:13 AM, Paul Sandoz wrote:
http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8071597-take-drop-while/webrev/
I opted to weight the documentation of the operations towards ordered streams in the
first paragraph. That is what makes most sense in term
Very nice. I just looked over the spec, for now.
* @param predicate a non-interfering,
* stateless
* predicate to apply elements to determine the longest
* prefix of elements.
Is this missing a *to*, “… predicate to apply to
On Jun 2, 2015, at 3:50 PM, Stefan Zobel wrote:
> Hi Paul,
>
> Looks good.
>
> I was wondering why the truncate method in Node.OfInt / OfLong / OfDouble
> did not receive the same
>
>
> +if (to == count()) {
> +spliterator.forEachRemaining(nodeBuilder);
> +} else
Hi Paul,
Looks good.
I was wondering why the truncate method in Node.OfInt / OfLong / OfDouble
did not receive the same
+if (to == count()) {
+spliterator.forEachRemaining(nodeBuilder);
+} else {
+for (int i = 0; i < size &&
spliterator.tryAdvance(nodeBui
Nice,
another example of takeWhile is how to iterate over a linked list,
class Entry {
private final Entry next;
private final Object value;
Entry getNext() { return next; }
Object getValue() { return value; }
}
Entry head = ...
Stream.iterate(head, Entry::getNext)
.takeWhile(Object
Hi,
Please review this webrev that adds take/dropWhile operations to streams:
http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8071597-take-drop-while/webrev/
I opted to weight the documentation of the operations towards ordered streams
in the first paragraph. That is what makes most sense in ter
21 matches
Mail list logo