Collection

trait Collection[+A] extends Able.Stream[A] with Able.Size

Value Collection

Collection is the root of collections framework

There are 3 main subtypes:

  • Idx - values can be accessed by Int index
  • Lookup - values can be accessed by key lookup
  • Set - collection of unique values
Source
__.scala
trait Able.Size
trait Able.Stream[Collection.A]
class java.lang.Object
trait scala.Matchable
class Any
trait Idx[Idx.A]
trait J.Array
class Pack[Pack.A]
class Boolean.G.Pack[Boolean.G.Pack.A]
class Byte.G.Pack[Byte.G.Pack.A]
class Char.G.Pack[Char.G.Pack.A]
class Double.G.Pack[Double.G.Pack.A]
class Float.G.Pack[Float.G.Pack.A]
class Int.G.Pack[Int.G.Pack.A]
class Long.G.Pack[Long.G.Pack.A]
class Short.G.Pack[Short.G.Pack.A]
trait Idx.Mutable[Idx.Mutable.A]
trait Idx.ObservableMutable[Idx.ObservableMutable.A]
class Idx.ObservableMutable.X.Abstract[Idx.ObservableMutable.X.Abstract.A]
class Idx.ObservableMutable.X.Basic[Idx.ObservableMutable.X.Basic.A]
class Idx.Mutable.X.Abstract[Idx.Mutable.X.Abstract.A]
class Idx.Observable.Event.Recorder[Idx.Observable.Event.Recorder.A]
trait Idx.Observable[Idx.Observable.A]
class Idx.Observable.X.Abstract[Idx.Observable.X.Abstract.A]
trait Idx.Observable.X.Base[Idx.Observable.X.Base.A]
trait Idx.Selection[Idx.Selection.A]
trait Idx.Selection.Observable[Idx.Selection.Observable.A]
class Idx.X.Abstract[Idx.X.Abstract.A]
trait Lookup[Lookup.A, Lookup.B]
trait J.Object
trait Lookup.Mutable[Lookup.Mutable.A, Lookup.Mutable.B]
class Lookup.Mutable.X.Abstract[Lookup.Mutable.X.Abstract.A, Lookup.Mutable.X.Abstract.B]
class Lookup.Mutable.X.Concurrent[Lookup.Mutable.X.Concurrent.A, Lookup.Mutable.X.Concurrent.B]
class Lookup.Mutable.X.Basic[Lookup.Mutable.X.Basic.A, Lookup.Mutable.X.Basic.B]
class Lookup.Stable[Lookup.Stable.A, Lookup.Stable.B]
class Byte.G.Lookup.Stable[Byte.G.Lookup.Stable.A, Byte.G.Lookup.Stable.B]
class Char.G.Lookup.Stable[Char.G.Lookup.Stable.A, Char.G.Lookup.Stable.B]
class Int.G.Lookup.Stable[Int.G.Lookup.Stable.A, Int.G.Lookup.Stable.B]
class Long.G.Lookup.Stable[Long.G.Lookup.Stable.A, Long.G.Lookup.Stable.B]
class Short.G.Lookup.Stable[Short.G.Lookup.Stable.A, Short.G.Lookup.Stable.B]
class Set[Set.A]
class Byte.G.Set[Byte.G.Set.A]
class Char.G.Set[Char.G.Set.A]
class Int.G.Set[Int.G.Set.A]
class Long.G.Set[Long.G.Set.A]
class Short.G.Set[Short.G.Set.A]
trait Collection.Mutable[Collection.Mutable.A]
trait Collection.ObservableMutable[Collection.ObservableMutable.A]
trait Collection.Observable[Collection.Observable.A]

Def

def size: Int
Source
__.scala
def stream: Stream[A]

Stream elements

Stream elements

Returns a stream of all collection elements

Unless specifically defined, the order must be assumed as random

  val c = Collection(1,3,5,7)
  c.stream.tp

  // Output
  Stream(1, 3, 5, 7)
Source
__.scala

Extension

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

Shortcut to .stream method

Shortcut to .stream method

Call is inlined and is equivalent to calling method "stream" itself.

Source
__.scala
inline def contains[A](v: A): Boolean
Source
__.scala
inline def mapView[A](f: A => B): Collection[B]
Source
__.scala