Does the Java standard library have any functional data structures, like immutable Sets, Lists, etc., with functional update?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Functional java has Sets, Lists and more interesting abstractions.
It's always nice to see Google Collections plugged, but no, we do not have this. I don't know of any Java library that does. Inside Google, we implemented some functional List structures, and guess what? No one uses them. So they aren't likely to become open-sourced any time soon.
You don't need scala. Just pass your collection into:
I just saw this from another SO question:
Google's ImmutableSet
http://google-collections.googlecode.com/svn/trunk/javadoc/com/google/common/collect/ImmutableSet.html
from the docs:
edited to incorporate comment.
Take a look at Google collections.
I know this is an old question but a bit of searching around tells me that now we have an alternative for Functional Java.
JavasLang looks like an interesting library for declarative programming and functional data structures in Java.
I haven't compared it with Functional Java in terms of ease of use and performance, but I'd love to get any pointers on that.
If you are interested in collections manipulation in a functional style give a look to lambdaj