Gof Iterator

Iterator in modern Java: traversing an aggregate without exposing it, and choosing between Iterator, Stream and Spliterator — external pull versus internal lazy pipeline versus the parallel decomposition primitive. Covers when a Spliterator can adapt to both, what fail-fast really promises and how weakly consistent iterators differ, streams that hold a resource and must be closed, remote pagination as iteration with page drift, and the characteristics that decide whether a stream can be sized or split. Use when exposing a collection from a type, when a custom traversal is being written, when ConcurrentModificationException appears, when a stream over a file or a result set leaks, when paging through a remote API, or when a parallel stream is not faster. Does not cover stream pipeline design and collectors in general, the tree being traversed (gof-composite), adding operations over it (gof-visitor), or database paging strategy.

robsonkades Updated

File contents

robsonkades/agent-skills/tree/main/skills/gof-iterator commit e95073911f

Frequently asked questions

npx skillmds@latest add robsonkades/gof-iterator