So, as the title asks, can Java Streams be considered an implementation of the Iterator pattern?
Can we consider that the .stream()
call on a Collection create some sort of an iterator which allows you to parse the elements of that Collection, without actually exposing the representation of the Collection? (Which is what the Iterator Pattern implies, if I am not mistaking)
EDIT: to avoid confusion, please note that I am not interested in Java's Iterator interface, I just want to know if Java Streams can be considered an implementation of the Iterator Design Pattern, and why?
Aucun commentaire:
Enregistrer un commentaire