Java 8 java.util.stream.Streams [英] Java 8 java.util.stream.Streams
问题描述
我看到很多博客文章都提到了Streams类,我看到它曾经是 lambda分支API的一部分。它现在似乎是非公共API,它与之前的实现不匹配。是否有不同的方法来执行 Streams.concat()
或将多个值附加到流?
I see many blog posts mention a Streams class and I see it was once part of the lambda branch API. It appears to be non-public API now and it does not match the previous implementation. Is there a different way to do Streams.concat()
or to append multiple values to a stream?
推荐答案
Streams
类被拆分,其中一些方法被移动到 StreamSupport ,在最新版本中不包含 concat
方法。 此处解释了拆分的基本原理。
The Streams
class got split and some of its methods were moved to StreamSupport, which does not contain a concat
method in the latest build. The rationale for the split is explained here.
concat 的具体情况。 java.net/pipermail/lambda-libs-spec-experts/2013-May/001718.html\">这篇文章,建议删除它,显然已删除。
The specific case of concat
has been mentioned separately in this post where it was proposed for removal and was apparently removed.
然而后来的帖子似乎表示它将在未来版本中重新出现。
However a later post seems to indicate that it will reappear in future builds.
这篇关于Java 8 java.util.stream.Streams的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!