More.JavaCollections

Java Collections Extension

These are extension methods universally available for all Java Collections, which extend java.lang.Iterable.

Java List, Vector, Set, Iterator, etc. have those methods.

Also note that all Java collections are implicitly convertibe to Stream, thus they can be used directly everywhere where Stream is required.

Source
__.scala
class java.lang.Object
trait scala.Matchable
class Any

Def

inline def ~~[A]: Stream[A]

Alias to .stream

Alias to .stream

Note. In cases when target collection already has a "stream" method with different semantics, calling ~~ is the only option.

Source
__.scala
inline def pack[A](using s: Specialized[A]): s.Pack

Pack of elements

Pack of elements

Returns Pack of collection elements

Source
__.scala
inline def stream[A]: Stream[A]

Stream of elements

Stream of elements

Returns Stream of collection elements

Source
__.scala