Eclipse Collections被Java 8弃用了吗?

我最近偶然发现了
Eclipse Collections,它们看起来很棒 – 几乎和Java 8流看起来一样棒.我通读了一些介绍,演示文稿和教程,看起来几乎所有EC都添加了,你现在可以使用流.

在没有任何意义下放下EC的情况下,现在我们有了流,有没有任何价值库,可能在我读到的内容中被掩盖了?或者它基本上是Joda时间的方式;它是如此优秀以至于它几乎逐字逐句地被Java所采用,否定了对库的需求?

最佳答案 从
https://www.eclipse.org/collections/

History of Eclipse Collections
The origin of Eclipse Collections was
started off as a collections framework named Caramel at Goldman Sachs
in 2004. Since then the framework has evolved, and in 2012, it was
open sourced to GitHub as a project called GS Collections.

GS Collections has been presented at number of conferences including
JVM Summit in 2012 and JavaOne in 2014. A performance comparison
between the parallel lazy implementations of Java 8, Scala and GS
Collections was presented at QCon New York in 2014. Also articles
about GS Collections (Part1 / Part2) have published on InfoQ.com
showing some of the capabilities of the collections framework through
examples, and also interviews to the creator of GS Collections.

Over the years, around 40 or so developers from the same company have
contributed to the collections framework.

To maximize the best nature of open source project, GS Collections has
been migrated to the Eclipse Foundation, re-branded as Eclipse
Collections in 2015. Now the framework is fully open to the community,
accepting contributions!

它似乎还活着.如果您阅读上面的页面,它可以完全使用java 8 lambda.

boolean anyPeopleHaveCats =
  this.people
    .anySatisfy(person -> person.hasPet(PetType.CAT));

boolean anyPeopleHaveCats =
  this.people
    .stream()
    .anyMatch(person -> person.hasPet(PetType.CAT));

当您在https://github.com/eclipse/eclipse-collections查看存储库时,您可以看到仍然有贡献并合并到其中.

所以我想说它并没有被弃用,但是你可以使用自己的代码和java流来使用方法的额外功能,使流媒体更容易一些.

它仍然添加了简单的比较器功能等.所以你不必编写自己的,你可以实现一个随时可用的lamda方法或流解析器,以满足您的需求.它看起来似乎是多余的,因为anySatisfy看起来很像过滤器,但它确实通过写出代码本身预期会发生什么来增加代码的清晰度.
在某些情况下,堆栈和包对我来说似乎很有用.有时你不想使用流,因为它是一个小集合(1000或更少),使流初始化的开销不值得.
这使得编写性能更好的更小代码变得更容易.

它可能没有java8之前那么重要,但它仍然有一席之地.

点赞