Collection

trait Collection[+A] extends Able.~[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
  • StableSet - collection of unique values
Source
__.scala
trait Able.Size
trait Able.~[A]
class java.lang.Object
trait scala.Matchable
class Any

Def

@scala.annotation.targetName("stream")
def ~: ~[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.~.tp

  // Output
  ~(1, 3, 5, 7)
Source
__.scala
override def isEmpty: Boolean

Empty check

Empty check

Returns true if instance is empty.

Definition Classes
Inherited from
Size
Source
Size.scala
override def size: Int

Element count

Element count

Retuns element count

Definition Classes
Source
__.scala

Extension

inline def contains[A](inline v: A): Boolean
Source
__.scala
@scala.annotation.targetName("map_View")
inline def map_^[A](inline f: A => B): Collection[B]
Source
__.scala
@scala.annotation.targetName("readOnly_View")
inline def readOnly_^[A]: Collection[A]
Source
__.scala