java8 collections_Eclipse Collections被Java 8弃用了吗?

我最近偶然发现了

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

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

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));

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

它仍然添加了简单的比较器功能等.所以你不必编写自己的,你可以实现一个随时可用的lamda方法或流解析器,以满足您的需求.它看起来似乎是多余的,因为anySatisfy看起来很像过滤器,但它确实通过写出代码本身预期会发生什么来增加代码的清晰度.

在某些情况下,堆栈和包对我来说似乎很有用.有时你不想使用流,因为它是一个小集合(1000或更少),使流初始化的开销不值得.

这使得编写性能更好的更小代码变得更容易.

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值