J.Util.Proxy.Idx.M.Basis

Source
Idx.scala
trait Idx.Mutable[A]
trait Able.Contain[A]
trait Able.Add[A]
trait Idx[A]
trait Collection[A]
trait Able.Size
trait Able.~[A]
class java.lang.Object
trait scala.Matchable
class Any

Def

@scala.annotation.targetName("stream")
override 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)
Definition Classes
Inherited from
Basis
Source
Idx.scala
@scala.annotation.targetName("_addOpt")

Alias for addAll

Alias for addAll

Generally Opt could be added as a stream.

This overload is sligtly more efficient, but it also required for mapped Opt expressions, where Opt type is harder to resolve and it would not compile.

Inherited from
Add
Source
Add.scala
@scala.annotation.targetName("_addAll")

Alias for addAll

Alias for addAll

Calls addAll and returns container

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

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

 x.~.tp // ~~(1, 2, 3, 4, 5, 6, 7, 8, 9)
Inherited from
Add
Source
Add.scala
@scala.annotation.targetName("_addAllAt")
def ++=@(position: Int, v: ~[A]): J.Util.Proxy.Idx.M.Basis[A]

Alias for addAllAt

Alias for addAllAt

Adds stream elements at given position

  // Generic example
  val x = ('A' <> 'F').~.toBuffer

  x ++=@ (4, 'e' <> 'g') ++=@ (1, ~~('b','c','d'))

  x.~.tp // Prints ~(A, b, c, d, B, C, D, e, f, g, E, F)
Inherited from
Mutable
Source
__.scala
@scala.annotation.targetName("_add")

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
@scala.annotation.targetName("_addAt")
def +=@(position: Int, v: A): J.Util.Proxy.Idx.M.Basis[A]

Alias for addAt

Alias for addAt

Adds element at given position

  // Generic example
  val x = ('A' <> 'F').~.toBuffer

  x +=@ (3, 'd') +=@ (2, 'c') +=@ (1, 'b') +=@ (0, 'a')

  x.~.tp // Prints ~(a, A, b, B, c, C, d, D, E, F)
Inherited from
Mutable
Source
__.scala
@scala.annotation.targetName("_removeAll")

Alias for removeAll

Alias for removeAll

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

Returns the collection itself

Inherited from
Mutable
Source
Mutable.scala
@scala.annotation.targetName("_remove")

Alias for remove

Alias for remove

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

Returns the collection itself

Inherited from
Mutable
Source
Mutable.scala
override def add(v: A): Unit
Definition Classes
Source
Idx.scala
override def addAll(v: ~[A]): Unit
Definition Classes
Source
Idx.scala
override def addAllAt(n: Int, e: ~[A]): Unit
Definition Classes
Source
Idx.scala
override def addAt(n: Int, e: A): Unit
Definition Classes
Source
Idx.scala
override def apply(i: Int): A

Returns element at specified position

Returns element at specified position

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

 idx(1).tp // Prints: B

 idx(4).tp // Prints: E
Definition Classes
Inherited from
Basis
Source
Idx.scala
override def clear: Unit

Remove everything

Remove everything

Discards all elements, so the colection size will become 0

Definition Classes
Source
Idx.scala
override def contains(v: A): Boolean
Definition Classes
Source
Idx.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 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

Definition Classes
Inherited from
Basis
Source
Collection.scala
@scala.annotation.targetName("remove_Range")
override def remove_<>(r: Int.<>): Unit

Remove range

Remove range

Removes elements at given range

 // Generic example
 val x = (0 <> 10).~.toBuffer

 x.remove(7 <> 8)
 x.remove(2 <> 4)

 x.~.tp // Prints ~(0, 1, 5, 6, 9, 10)
Definition Classes
Source
Idx.scala
override def removeAll(s: ~[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

Definition Classes
Inherited from
Basis
Source
Collection.scala
override def removeAt(i: Int): Unit
Definition Classes
Source
Idx.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
override def reposition(v: Idx.Permutation): Unit

Reorganizes elements

Reorganizes elements

Reorganizes elements according to the given permutation

  val im: Idx.Mutable[Int] = (0 <> 9).~.toBuffer

  val p = Idx.Permutation.pairs(3 -> 7, 7 -> 3, 4 -> 6, 6 -> 4)

  im.~.tp
  im.reposition(p)
  im.~.tp

  // Output
  ~(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
  ~(0, 1, 2, 7, 6, 5, 4, 3, 8, 9)
Definition Classes
Source
Idx.scala
override def size: Int

Element count

Element count

Retuns element count

Definition Classes
Inherited from
Basis
Source
Collection.scala
override def sort(using scala.Ordering[A]): Unit

Sort elements

Sort elements

Sorts elements in this container

Definition Classes
Source
Idx.scala
override def updateAllAt(i: Int, s: ~[A]): Unit
Definition Classes
Source
Idx.scala
override def updateAt(n: Int, a: A): Unit
Definition Classes
Source
Idx.scala