java.util.stream.Streamable发生了什么?

早期的jdk8-ea javadocs like this表示有一个java.util.stream.Streamable接口,它似乎与Iterable对Iterator具有相同的关系.

现在看来,我们被困在供应商< Stream>,这肯定是不一样的.

Streamable发生了什么?

解决方法

之前已经删除了.删除The rationale由Brian Goetz提供:

Currently the only
implementor is Collection,and all of the other stream-bearing methods
are serving up specialized streams (chars(),codePoints(),lines(),etc)
with a method name that is more suitable than “stream”. So I think we
should drop Streamable and leave the stream() / parallel() methods on
Collection (or possibly move them up Iterable).

And also

I’m starting to think that Streamable is not carrying its weight. I’d
like to consider dropping Streamable,at which point the base-most
implementation of parallel() is in Collection,and I’d also suggest we
consider renaming that to parallelStream().

this other post他补充说:

if everything that is Iterable is effectively Streamable (because Iterable has a stream()) method,and everything Streamable is effectively Iterable (because you can turn a Spliterator into an Iterator),aren’t they then the same abstraction?

相关文章

前言 逆向工程从数据库表直接生成代码,是日常开发中常用的敏...
前言 Java网络编程之Socket套接字,Socket套接字使用TCP提供...
前言 虽然现在已经很少项目会涉及GUI技术,但作为一个合格的...
前言 几乎所有的系统都有密码安全要求,这是基础的安全策略,...
前言 当我们在写设计文档,或者是其他涉及到数据架构、表结构...
前言 Fiddler是一款强大的Web调试代理工具,又称抓包软件,本...