ModernJava icon indicating copy to clipboard operation
ModernJava copied to clipboard

Stream improvements

Open Alathreon opened this issue 2 months ago • 0 comments

Programs often have to transform all of the elements in a collection in order to produce a new collection. That's not quite streams are for, they are not for specifically "collections", are not specifically for "transforming", are not specifically for "all elements".

In terminal operations, empathize that the stream is only executed once the terminal operation is called (that's why you can only call a terminal operation once)

Maybe move terminal operations introduction part before the intermediate operations so the users can already test the streams.

Explain limit and skip.

Explain flatMap

Explain findAny and findFirst

Explain sorted

Explain distinct

Explain reducing

Explain more collectors

Explain gatherers

Explain shortcutting and stateful operations

Explain IntStream, etc

List other ways to get streams (Random/Generator, Files, String, etc)

Alathreon avatar Nov 07 '25 23:11 Alathreon