Byte.G.Idx.Mutable

trait Mutable[A <: Raw.Byte] extends Byte.G.Idx[A] with Byte.G.Collection.Mutable[A] with Idx.Mutable[A]
Source
Idx.scala
trait Idx.Mutable[A]
trait Able.Add[A]
trait Byte.G.Idx[A]
trait Able.Contain[A]
trait Idx[A]
trait Collection[A]
trait Able.Size
trait Able.~[A]
class java.lang.Object
trait scala.Matchable
class Any
class Byte.G.Buffer[A]

Def

@scala.annotation.targetName("stream")
override def ~: Byte.G.~[A]
Definition Classes
Inherited from
Idx
Source
Idx.scala
@scala.annotation.targetName("_addOpt")
def ++=(v: Opt[A]): Byte.G.Idx.Mutable[A]

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")
def ++=(v: ~[A]): Byte.G.Idx.Mutable[A]

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]): Byte.G.Idx.Mutable[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")
override def +=(v: A): Byte.G.Idx.Mutable[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)
Definition Classes
Inherited from
Mutable
Source
Collection.scala
@scala.annotation.targetName("_addAt")
override def +=@(position: Int, v: A): Byte.G.Idx.Mutable[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)
Definition Classes
Source
Idx.scala
@scala.annotation.targetName("_removeAll")
def --=(v: ~[A]): Byte.G.Idx.Mutable[A]

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")
def -=(v: A): Byte.G.Idx.Mutable[A]

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
@scala.annotation.targetName("pack")
def ><: Byte.G.><[A]
Inherited from
Collection
Source
Collection.scala
def add(v: A): Unit

Append element

Append element

Adds given element to the end of this Idx

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

Append all

Append all

Adds all stream values to the end of this Idx

Definition Classes
Inherited from
Mutable
Source
__.scala
def addAllAt(position: Int, v: ~[A]): Unit

Add stream at position

Add stream at position

Adds stream elements at given position

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

  x.addAllAt(4, 'e' <> 'g')
  x.addAllAt(1, ~~('b','c','d'))

  x.~.tp // Prints ~(A, b, c, d, B, C, D, e, f, g, E, F)
Inherited from
Mutable
Source
__.scala
def addAt(i: Int, v: A): Unit
Source
Idx.scala
def apply(i: Int): A
Inherited from
Idx
Source
Idx.scala
override def clear: Unit
Definition Classes
Inherited from
Mutable
Source
__.scala
override def contains(v: A): Boolean
Definition Classes
Inherited from
Idx
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
def remove(v: A): Int

Remove element

Remove element

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

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

Inherited from
Mutable
Source
__.scala
@scala.annotation.targetName("remove_Range")
def remove_<>(range: 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)
Inherited from
Mutable
Source
__.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 removeAt(position: Int): Unit

Remove at position

Remove at position

Removes element at given position

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

 x.remove(2)
 x.remove(1)

 x.~.tp // Prints ~(A, D)
Inherited from
Mutable
Source
__.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

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)
Inherited from
Mutable
Source
__.scala
override def size: Int

Element count

Element count

Retuns element count

Definition Classes
Inherited from
Idx
Source
__.scala
def sort(using c: scala.Ordering[A]): Unit

Sort elements

Sort elements

Sorts elements in this container

Inherited from
Mutable
Source
__.scala
def updateAllAt(position: Int, s: ~[A]): Unit

Update many at position

Update many at position

Replaces elements starting at given position with stream values

Inherited from
Mutable
Source
__.scala
def updateAt(i: Int, v: A): Unit
Source
Idx.scala