Stream is like an Iterator with mostly same methods.
However, there are 2 reasons why they are not completely same:
Iterator shares parents with eager collections, thus there are some methods which do not make sense for Iterator, like size, foldRight, patch, etc.
Stream does not need to compromise
Iterator tries to comply with feature set of a general Scala collection,
Stream implements everything what seems convenient with room to double method count in future
Following Iterator methods have custom match to Stream:
Stream is like an Iterator with mostly same methods. However, there are 2 reasons why they are not completely same:
Following Iterator methods have custom match to Stream:
++
--> +~exists
--> isAnyforall
--> isEveryisEmpty
--> primehasNext
--> primebuffered
--> toMemorycollectFirst
--> collectOptcorresponds
--> unequalOptdrop
--> dropNextfilterNot
--> dropfoldLeft
--> foldAsfoldRight
--> reverse + foldAsindexOf
--> findIdxOptlength
--> sizeOptmkString
--> formatnonEmpty
--> !primepadTo
--> not availablepatch
--> not availableproduct
--> not availablesameElements
--> unequalOptscanLeft
--> zipFoldAsscanRight
--> reverse + zipFoldAssize
--> sizeOptslice
--> letRangezipWithIndex
--> zipIdx