How To Use Classic Custom Data Structures As Java 8 Streams

后端 未结 2 1020
心在旅途
心在旅途 2021-02-10 09:52

I saw a SO question yesterday about implementing a classic linked list in Java. It was clearly an assignment from an undergraduate data structures class. It\'s easy to find qu

2条回答
  •  一向
    一向 (楼主)
    2021-02-10 10:40

    I'd look at http://www.javaslang.io for inspiration, a library that does exactly what you want to do: Implement custom lists, trees, etc. in a Java 8 manner.

    It specifically doesn't closely couple with the JDK collections outside of importing/exporting methods, but re-implements all the immutable collection semantics that a Scala (or other FP language) developer would expect.

提交回复
热议问题