c

Idx.OM.A.Basic

class Basic[A] extends Idx.O.A.Base[A] with Idx.OM[A] with Custom.Proxy.Idx.Like[A]

Ordering
  1. Alphabetic
Inherited
  1. Basic
  2. Custom.Proxy.Idx.Like
  3. Any.Wrap
  4. Idx.OM
  5. Idx.M
  6. Any.Collection.M
  7. Any.Able.Remove
  8. Any.Able.Add
  9. Idx.O.A.Base
  10. Any.Ref.Extra
  11. Any.Ref.Extra.Observable
  12. Any.Ref.Extra.Event1
  13. Any.Ref.Extra.Event.Like
  14. Any.Ref.Extra.Like
  15. Idx.O
  16. Any.Collection.O
  17. Any.O
  18. Idx
  19. Any.Collection
  20. scala.AnyRef
  21. scala.Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type

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

Constructor

  1. new Basic(initSize: Int = \/)
    Definition Classes
    Basic

Constant

  1. val real: Idx.Array.Buffer.Refs[A]
    Attributes
    protected
    Definition Classes
    Basic_Trait

Method

  1. def add(a: A): Unit

    Add

    Add

    Adds given v to target container

    // Generic example
    val x = Idx.M.make(1, 2, 3)
    
     x add 4
     x add 5
     x add 6
    
     x.all.lp // Prints: ~(1, 2, 3, 4, 5, 6)
    Definition Classes
    Basic_TraitAdd
  2. def addAll(s: ~[A]): Unit

    Add Stream

    Add Stream

    Adds given stream elements to target container

    // Generic example
    val x = Idx.M.make(1, 2, 3)
    
     x addAll 4 <> 6
     x addAll 7 ~+ 8 + 9
    
     x.all.lp // ~(1, 2, 3, 4, 5, 6, 7, 8, 9)
    Definition Classes
    Basic_TraitAdd
  3. def addAllAt(i: Int, s: ~[A]): Unit

    Add stream at position

    Add stream at position

    Adds stream elements at given position

    // Generic example
    val x = ('A' <> 'F').all.to[Idx.M]
    
    x.addAllAt(4, 'e' <> 'g')
    x.addAllAt(1, 'b' ~+ 'c' + 'd')
    
    x.all.lp // Prints: ~(A, b, c, d, B, C, D, e, f, g, E, F)
    Definition Classes
    Basic_Trait
  4. def addAt(i: Int, a: A): Unit

    Add at position

    Add at position

    Adds element at given position

    // Generic example
    val x = ('A' <> 'F').all.to[Idx.M]
    
    x.addAt(3, 'd')
    x.addAt(2, 'c')
    x.addAt(1, 'b')
    x.addAt(0, 'a')
    
    x.all.lp // Prints: ~(a, A, b, B, c, C, d, D, E, F)
    Definition Classes
    Basic_Trait
  5. 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
    Like_Trait_Trait
  6. def apply(i: Int): A

    Returns element at position

    Returns element at position

    Definition Classes
    Like_Trait
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def clear: Unit

    Remove everything

    Remove everything

    Clears container of all elements

    Definition Classes
    _TraitRemove
  9. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. def fireChange(c: Idx[Idx.O.Change[A]]): Unit
    Attributes
    protected
    Definition Classes
    Base
  14. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. def multiChange(ch: (Idx.M[A]) ⇒ Any): Unit

    Transactional change

    Transactional change

    Allows to do many changes to the collection, while only one change event will be created and propagated

    val c = Any.Collection.OM.make[Int]
    
    c.onChange(_.all.tp("Event: "))
    
    c.multiChange(ch => {
       ch add 99
       ch +~= 0 <> 5
       ch =-~ 3 <> 4
       ch =+ 100
    })
    
    c.all.lp
    
    // Output
    Event: ------ ----
           name   item
           ------ ----
           Add    99
           Add    0
           Add    1
           Add    2
           Add    3
           Add    4
           Add    5
           Remove 3
           Remove 4
           Add    100
           ------ ----
    ~(100, 5, 2, 1, 0, 99)
    Definition Classes
    Basic_Trait
  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  20. def order(o: Ordering[A]): Unit

    Sort

    Sort

    Reorganizes elements according to the given Ordering

    val iw: Idx.M[Int] = (0 ~+ 7 + 1 + 6 + 2 + 5 + 3 + 4).to[Idx.M]
    
    iw.order(Ordering.A.Int) // 'iw.sort' is same library shortcut
    
    iw.all.lp // Prints: ~(0, 1, 2, 3, 4, 5, 6, 7)*
    Definition Classes
    Basic_Trait
  21. def refreshAt(r: Idx.Range): Unit

    Refresh range

    Refresh range

    Two things happen:

    • If any element at the specified range implements Any.Able.Refresh, its refresh method is executed
    • An event containing Idx.Refresh is propagated to this Idx listeners.
    val c: Idx.OM[Int] = (1 <> 20).all.to[Idx.OM]
    
    c.onChange(_.all.tp)
    
    c.refreshAt(10 <> 15)
    
    // Output
    
    ------- ---------
    name    range
    ------- ---------
    Refresh 10 <>> 16
    ------- ---------
    Definition Classes
    Basic_Trait
  22. def remove(e: A): Unit

    Remove

    Remove

    Removes all elements equal to provided

    // Generic example
    val x = Idx.M.make(1, 2, 3, 4, 5)
    
    x.remove(2)
    x.remove(3)
    x.remove(4)
    
    x.all.lp // Prints: ~(1, 5)
    Definition Classes
    _TraitRemove
  23. def removeAll(s: ~[A]): Unit

    Remove all

    Remove all

    Removes all elements equal to any in provided stream

    // Generic example
    val x = Idx.M.make(1, 2, 3, 4, 5)
    
    x.removeAll(2 <> 4)
    x.removeAll(2 ~+ 3 + 4)
    
    x.all.lp // Prints: ~(1, 5)
    Definition Classes
    Remove
  24. def removeAt(r: Idx.Range): Unit

    Remove range

    Remove range

    Removes elements at given range

    // Generic example
    val x = (0 <> 10).all.to[Idx.M]
    
    x.removeAt(7 <> 8)
    x.removeAt(2 <> 4)
    
    x.all.lp // Prints: ~(0, 1, 5, 6, 9, 10)
    Definition Classes
    Basic_Trait
  25. def removeAt(position: Int): Unit

    Remove at position

    Remove at position

    Removes element at given position

    // Generic example
    val x = ('A' <> 'D').all.to[Idx.M]
    
    x.removeAt(2)
    x.removeAt(1)
    
    x.all.lp // Prints: ~(A, D)
    Definition Classes
    _Trait
  26. def replaceAll(s: ~[A]): Unit

    Replaces all elements

    Replaces all elements

    Removes all elements and inserts new ones creating just one change event

    val c: Any.Collection.OM[Int] = (1 <> 3).all.to[Any.Collection.OM]
    c.onChange(_.all.tp("Event: "))
    
    c.all.lp.lp
    c.replaceAll(10 <> 12)
    c.all.lp
    
    // Output
    ~(3, 2, 1)
    
    Event: ------ -----
           name   item
           ------ -----
           Remove 3,2,1
           Add    10
           Add    11
           Add    12
            ------ -----
    ~(12, 11, 10)
    Definition Classes
    _Trait
  27. def reposition(r: Idx.Range.Reposition): Unit

    Reorganizes elements

    Reorganizes elements

    Reorganizes elements according to the given reposition

    val iw: Idx.M[Int] = (0 <> 9).all.to[Idx.M]
    
    val r = Idx.Reposition.getByAll((3, 7) ~+ (7, 3) + (4, 6) + (6, 4))
    
    iw.all.lp
    iw.reposition(r)
    iw.all.lp
    
    // Output
    ~(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
    ~(0, 1, 2, 7, 6, 5, 4, 3, 8, 9)
    Definition Classes
    Basic_Trait
  28. 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
    Like_Trait
  29. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  30. def toString(): String
    Definition Classes
    AnyRef → Any
  31. def update(i: Int, a: A): Unit

    Replaces element at position

    Replaces element at position

    Replaces an element at given position

    val iw: Idx.M[Int] = (0 <> 7).all.to[Idx.M]
    
    iw.update(7, 777)
    iw.update(3, 333)
    
    iw.all.lp // Prints: ~(0, 1, 2, 333, 4, 5, 6, 777)
    Definition Classes
    Basic_Trait
  32. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. 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. def +=(v: A): Basic.this.type

    Add operator

    Add operator

    Calls add and returns container

    // Generic example
    val x = Idx.M.make(1, 2, 3)
    
     x += 4 += 5 += 6
    
     x.all.lp // Prints: ~(1, 2, 3, 4, 5, 6)
    Definition Classes
    Add
  4. def +=@(position: Int, element: A): Basic.this.type

    Add at position operator

    Add at position operator

    Adds element at given position

    // Generic example
    val x = ('A' <> 'F').all.to[Idx.M]
    
    x +=@ (3, 'd') +=@ (2, 'c') +=@ (1, 'b') +=@ (0, 'a')
    
    x.all.lp // Prints: ~(a, A, b, B, c, C, d, D, E, F)
    Definition Classes
    _Trait
  5. def +~=(stream: ~[A]): Basic.this.type

    Add Stream operator

    Add Stream operator

    Calls addAll and returns container

    // Generic example
    val x = Idx.M.make(1, 2, 3)
    
    x +~= (4 <> 6) +~= (7 ~+ 8 + 9)
    
    x.all.lp // ~(1, 2, 3, 4, 5, 6, 7, 8, 9)
    Definition Classes
    Add
  6. def +~=@(position: Int, a: ~[A]): Basic.this.type

    Add all at position operator

    Add all at position operator

    Adds stream elements at given position

    // Generic example
    val x = ('A' <> 'F').all.to[Idx.M]
    
    x +~=@ (4, 'e' <> 'g') +~=@ (1, 'b' ~+ 'c' + 'd')
    
    x.all.lp // Prints: ~(A, b, c, d, B, C, D, e, f, g, E, F)
    Definition Classes
    _Trait
  7. def -=(element: A): Basic.this.type

    Remove operator

    Remove operator

    Removes all elements equal to provided

    // Generic example
    val x = Idx.M.make(1, 2, 3, 4, 5)
    
    x =- 2 =- 3 =- 4
    
    x.all.lp // Prints: ~(1, 5)
    Definition Classes
    Remove
  8. def -=@(range: Idx.Range): Basic.this.type

    Remove range operator

    Remove range operator

    Removes elements at given range

    // Generic example
    val x = (0 <> 10).all.to[Idx.M]
    
    x -=@ (7 <> 8) -=@ (2 <> 4)
    
    x.all.lp // Prints: ~(0, 1, 5, 6, 9, 10)
    Definition Classes
    _Trait
  9. def -=@(position: Int): Basic.this.type

    Remove at position operator

    Remove at position operator

    Removes element at given position

    // Generic example
    val x = ('A' <> 'D').all.to[Idx.M]
    
    x -=@ 2 -=@ 1
    
    x.all.lp // Prints: ~(A, D)
    Definition Classes
    _Trait
  10. def -~=(stream: ~[A]): Basic.this.type

    Remove all operator

    Remove all operator

    Removes all elements equal to any in provided stream

    // Generic example
    val x = Idx.M.make(1, 2, 3, 4, 5)
    
    x =-~ (2 <> 4) =-~ (2 ~+ 3 + 4)
    
    x.all.lp // Prints: ~(1, 5)
    Definition Classes
    Remove
  11. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any

Event

  1. def onChange(on: (Idx[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
    Base_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

Hidden

  1. def _addEntry(scope: AnyRef, value: Any): EventControl

    Creates entry

    Creates entry

    Adds new entry to the list

    Returns EventControl, a fancy interface to remove entry.

    Attributes
    protected[scalqa.Any.Ref.Extra]
    Definition Classes
    _TraitLike
  2. def _allEntries(scope: AnyRef): ~[Any.Ref.Extra.Entry]

    Enries stream

    Enries stream

    Provides stream of entries only for the specified scope.

    Attributes
    protected[scalqa.Any.Ref.Extra]
    Definition Classes
    _Trait
  3. def _change(f: (Idx.O.Change.Builder[A]) ⇒ Any): Idx.O.Change.Builder[A]
    Attributes
    protected
    Definition Classes
    Base
  4. def _entriesDescription: String

    Description

    Description

    String description, mostly for debugging.

    Attributes
    protected[scalqa.Any.Ref.Extra]
    Definition Classes
    _Trait
  5. def _fireEvent1[P1](scope: AnyRef, p1: P1): Int
    Attributes
    protected
    Definition Classes
    Event1
  6. def _hasListeners: Boolean
    Attributes
    protected
    Definition Classes
    Base
  7. def _isNoEntries: Boolean

    Empty check

    Empty check

    Returns true if there is no entries for all scopes

    Attributes
    protected[scalqa.Any.Ref.Extra]
    Definition Classes
    _Trait
  8. def _onAddEntry(scope: AnyRef, on: (Any.Ref.Extra.Entry) ⇒ Any): EventControl
    Attributes
    protected
    Definition Classes
    Observable
  9. def _onAddFirstEntryRun(scope: AnyRef, on: ⇒ Any): EventControl
    Attributes
    protected
    Definition Classes
    Observable
  10. def _onEvent1[P1](scope: AnyRef, f: (P1) ⇒ Any): EventControl
    Attributes
    protected
    Definition Classes
    Event1
  11. def _onRemoveEntry(scope: AnyRef, on: (Any.Ref.Extra.Entry) ⇒ Any): EventControl
    Attributes
    protected
    Definition Classes
    Observable
  12. def _onRemoveLastEntryRun(scope: AnyRef, on: ⇒ Any): EventControl
    Attributes
    protected
    Definition Classes
    Observable
  13. def _onStartListening(on: ⇒ Any): EventControl
    Attributes
    protected
    Definition Classes
    Base