J.Util.Proxy.Idx.O

abstract class O[A] extends J.Util.Proxy.Idx[A] with J.Util.Proxy.Idx.O.Base[A]
Source
Idx.scala
trait J.Util.Proxy.Idx.O.Base[J.Util.Proxy.Idx.O.A]
trait Idx.Observable[J.Util.Proxy.Idx.O.A]
trait Collection.Observable[J.Util.Proxy.Idx.O.A]
class J.Util.Proxy.Idx[J.Util.Proxy.Idx.O.A]
trait J.Util.Proxy.Idx.Base[J.Util.Proxy.Idx.O.A]
trait Idx[J.Util.Proxy.Idx.O.A]
class J.Util.Proxy.Collection[J.Util.Proxy.Idx.O.A]
trait J.Util.Proxy.Collection.Base[J.Util.Proxy.Idx.O.A]
trait J.Util.Proxy[Idx.Observable[J.Util.Proxy.Idx.O.A]]
trait Collection[J.Util.Proxy.Idx.O.A]
trait Able.Size
trait Able.Stream[J.Util.Proxy.Idx.O.A]
class java.lang.Object
trait scala.Matchable
class Any

Def

override def apply(i: Int): A

Returns element at specified position

Returns element at specified position

 val idx: Idx[Char] = ('A' <> 'Z').stream.pack

 idx(1).tp // Prints: B

 idx(4).tp // Prints: E
Definition Classes
Inherited from
Base
Source
Idx.scala
final override def onAdd[U](l: A => U): Event.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
Definition Classes
Inherited from
Observable
Source
__.scala
override def onChange[U](l: Pack[Idx.Observable.Event[A]] => U): Event.Control

On event

On event

Subscribes given function to all element changes

val idx: Idx.OM[Int] = Idx.OM[Int]()

idx.onChange(_.stream.tp)

idx ++= 1 <> 5

idx(2) = 22

idx.removeRange(3 <> 4)

idx.stream.tp

// Output
Stream(IdxChange{type=Add,range=0 <> 4,items=[1,2,3,4,5]})
Stream(IdxChange{type=Update,range=2 <> 2,items=22,oldItems=3})
Stream(IdxChange{type=Remove,range=3 <> 4,items=[4,5]})
Stream(1, 2, 22)
Definition Classes
Inherited from
Base
Source
Idx.scala
def onObservableChange[U](l: () => U): Event.Control
Inherited from
Observable
Source
Observable.scala
final override def onRemove[U](l: A => U): Event.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
Definition Classes
Inherited from
Observable
Source
__.scala
override def size: Int
Definition Classes
Inherited from
Base
Source
Collection.scala
override 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)
Definition Classes
Idx -> Base -> Idx -> Base -> Collection -> Stream
Inherited from
Idx
Source
Idx.scala