Collection.ObservableMutable

trait Able.Add[A]
trait Collection[A]
trait Able.Size
trait Able.~[A]
class Object
trait Matchable
class Any

Def

Inherited

@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)
Inherited from
Collection
Source
__.scala
@targetName("addAll")
inline def ++=(inline v: ~[A]): Collection.ObservableMutable[A]

Alias for addAll

Alias for addAll

Calls addAll and returns container

 // Generic example
 val x =  Idx.M(1, 2, 3)

 x ++= (4 <> 6) ++= Stream(7, 8, 9)

 x.~.tp // ~~(1, 2, 3, 4, 5, 6, 7, 8, 9)
Inherited from
Add
Source
Add.scala
@targetName("add")
inline def +=(inline v: A | Opt[A]): Collection.ObservableMutable[A]

Alias for add

Alias for add

Calls add and returns container

 // Generic example
 val x =  Idx.M(1, 2, 3)

  x += 4 += 5 += 6

  x.~.tp // Prints ~(1, 2, 3, 4, 5, 6)
Inherited from
Add
Source
Add.scala
@targetName("_removeAll")
inline def --=(inline v: ~[A]): Collection.ObservableMutable[A]

Alias for removeAll

Alias for removeAll

Removes all collection elements, which are equal to those in given stream

Returns count of removed elements, which can be 0, 1, or many

Inherited from
Mutable
Source
Mutable.scala
@targetName("_remove")
inline def -=(inline v: A): Collection.ObservableMutable[A]

Alias for remove

Alias for remove

Removes all collection elements, which are equal to the given value

Returns count of removed elements, which can be 0, 1, or many

Inherited from
Mutable
Source
Mutable.scala
def add(v: A): Unit

Add

Add

Adds given value to target container

 // Generic example
 val x =  Idx.M(1, 2, 3)

  x.add(4)
  x.add(5)
  x.add(6)

  x.~.tp // Prints ~(1, 2, 3, 4, 5, 6)
Inherited from
Add
Source
Add.scala
@targetName("add_Opt")
def add_?(o: Opt[A]): Unit

Optional add

Optional add

Adds element if option has value, does nothing for void option

Inherited from
Add
Source
Add.scala
def addAll(v: ~[A]): Unit

Add many

Add many

Adds given stream of elements to target container

 // Generic example
 val x =  Idx.M(1, 2, 3)

  x.addAll(4 <> 6)
  x.addAll( ~~(7,8,9))

  x.~.tp // Stream(1, 2, 3, 4, 5, 6, 7, 8, 9)
Inherited from
Add
Source
Add.scala
def clear: Unit

Remove everything

Remove everything

Discards all elements, so the colection size will become 0

Inherited from
Mutable
Source
Mutable.scala
def isEmpty: Boolean
Inherited from
Size
Source
Size.scala
def onAdd[U](l: A => U): Control

On element add

On element add

Subscribes given function to element add event

val co: Collection.ObservableMutable[Int] = Collection.OM[Int]()

co.onAdd("Added: "+ _ tp())

co ++= 1 <> 3

// Output
Added: 1
Added: 2
Added: 3
Inherited from
Observable
Source
Observable.scala
def onRemove[U](l: A => U): Control

On element remove

On element remove

Subscribes given function to element remove event

val co: Collection.ObservableMutable[Int] = Collection.OM[Int]()

co.onRemove("Removed: "+ _ tp())

co ++= 1 <> 10

co --= 5 <> 7

// Output
Removed: 7
Removed: 6
Removed: 5
Inherited from
Observable
Source
Observable.scala
def remove(v: A): Int

Remove element

Remove element

Removes all collection elements, which are equal to the given value

Returns count of removed elements, which can be 0, 1, or many

Inherited from
Mutable
Source
Mutable.scala
def removeAll(v: ~[A]): Int

Remove all streamed

Remove all streamed

Removes all collection elements, which are equal to those in given stream

Returns count of removed elements, which can be 0, 1, or many

Inherited from
Mutable
Source
Mutable.scala
def replaceAll(v: ~[A]): Unit

Replace everything

Replace everything

Discards all old elements and adds all provided elements

Inherited from
Mutable
Source
Mutable.scala
def size: Int
Inherited from
Collection
Source
__.scala