Card 10/ 10
All 10 cards
RecapDifficulty: Advanced1 min
One Source, Some Steps, One Result
Six things this topic established, and where each one was.
| The thing | Where |
|---|---|
| Intermediate operations describe; terminal operations run | A Pipeline That Does Nothing at All |
| The terminal operation pulls one element at a time through the whole chain | Watching a Pipeline Touch Three Elements |
map gives one value per element; flatMap flattens several into one stream | map Against flatMap |
collect and groupingBy decide the shape at the end | Collecting Into a List, a Set and a Map |
| A stream holds a way of pulling elements, so it cannot be run twice | Why You Cannot Use a Stream Twice |
| Parallel costs splitting and combining before it saves anything | Why parallel() Made It Slower |
A pipeline is a description of work, pulled by its last line. Every surprise in this topic — nothing happening, a stream that will not run twice, three hundred elements touched out of a thousand — is that one fact showing through.