trait _Trait[A] extends Idx[A] with Any.Collection.O[A]

Observable Idx Collection

Observable Idx collection allows to track all the changes by subscribing to onChange event

Ordering
  1. Alphabetic
Inherited
  1. O
  2. Any.Collection.O
  3. Any.O
  4. Idx
  5. Any.Collection
  6. scala.AnyRef
  7. scala.Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type

  1. type O.CHANGE = Idx.O.Change[A]
    Attributes
    protected
    Definition Classes
    _Trait_Trait

Method

  1. def all: ~[A]

    Returns a Stream of all elements

    Returns a Stream of all elements

    The element order is same as in the Idx.

    val index = Idx.*(1,3,5,7)
    index.all.lp
    // Output
    ~(1, 3, 5, 7)
    Definition Classes
    _Trait_Trait
  2. abstract def apply(idx: Int): A

    Returns element at position

    Returns element at position

    idx

    element position, must be in range (0 <>> size)

    val index = Idx.*(1,4,7,10)
    index(1).lp  // Prints: 4
    index(3).lp  // Prints: 10
    Definition Classes
    _Trait
  3. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  4. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  5. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  6. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  7. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  8. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  9. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  10. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. final def notify(): Unit
    Definition Classes
    AnyRef
  12. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  13. abstract def size: Int

    Number of elements

    Number of elements

    Readily available, not calculated element count

    Idx.*(1,3,5,7).size.lp  // Prints: 4
    Definition Classes
    _Trait
  14. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  15. def toString(): String
    Definition Classes
    AnyRef → Any
  16. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  17. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Operator

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any

Event

  1. abstract def onChange(f: (Idx[O.Change[A]]) ⇒ Any): EventControl

    Change Event

    Change Event

    Subscribes listener to be notified of all changes

    val c = Any.Collection.OM.make[Int]
    
    c.onChange(_.all tp "Event: ")
    
    c add 99
    c +~= 0 <> 5
    c =-~ 3 <> 5
    
    c.all.lp
    
    // Output
    Event: ---- ----
           name item
           ---- ----
           Add  99
           ---- ----
    Event: ---- ----
           name item
           ---- ----
           Add  0
           Add  1
           Add  2
           Add  3
           Add  4
           Add  5
           ---- ----
    Event: ------ ----
           name   item
           ------ ----
           Remove 3
           Remove 4
           Remove 5
           ------ ----
    ~(2, 1, 0, 99)
    Definition Classes
    _Trait_Trait
  2. def onObservableChange(f: () ⇒ Any): EventControl

    On change event

    On change event

    This is the most general event indicating a change

    Usually an object will have other more usable events, but they will also trigger this one

    The method is protected in order not to pollute application name space

    This event will likely be used by GUI controls, which will call it through the 'library'

    Attributes
    protected
    Definition Classes
    _Trait_Trait