Location of getStreamState [it2-bootstrap]

Deepak S Patwardhan deepak.patwardhan at itaas.com
Mon Jul 30 20:59:22 PDT 2012


Hello,

The following code works in the current lambda implementation (filter
returns Iterable)

Collection<String> names = ...
for (String name : names.filter(s -> s.length() > 10)) {...}

However, it will not work with it2-bootstrap because filter will return
Stream, which is not an Iterable.

Is this just a side-effect of the way Stream API has been (currently)
written OR is it a design goal to discourage external iteration on Stream?

Regards,
Deepak S Patwardhan.

-----Original Message-----
From: Brian Goetz [mailto:brian.goetz at oracle.com] 
Sent: 30 July 2012 18:29
To: Deepak S Patwardhan
Cc: lambda-dev at openjdk.java.net
Subject: Re: Location of getStreamState [it2-bootstrap]

> I am trying to understand the relation between Streamable and Stream 
> interfaces. I see that Streamable has a method named getStreamState - 
> should this not be in Stream ?

The role of getStreamState is still under discussion.  It may be exposed, or
removed.  Right now it exists only for the implementation, not the API.

> On a lighter note, I was wondering if the *main* interface inside 
> java.util.streams is Stream or is it StreamOps?

Note that StreamOps is not a public class.  





More information about the lambda-dev mailing list