Idx

trait Idx[+A] extends Collection[A]

Indexed Collection

Elements in Idx can be efficiently accessed with Int index starting from 0

The immutable implementation of Idx is >< (pack)

Source
__.scala
trait Collection[A]
trait Able.Size
trait Able.~[A]
class java.lang.Object
trait scala.Matchable
class Any

Def

@scala.annotation.targetName("stream")
def ~: ~[A]

Returns a Stream of all elements

Returns a Stream of all elements

The element order is same as in the Idx itself

  val l: Idx[Char] = ('a' <> 'g').~.><

  l.~.tp  // Prints ~(a, b, c, d, e, f, g)
Source
__.scala
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
Source
__.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 size: Int

Element count

Element count

Retuns element count

Definition Classes
Source
__.scala

Extension

@scala.annotation.targetName("at_Opt")
def at_?[A](position: Int): Opt[A]
Source
__.scala
def contains[A](v: A): Boolean
Source
__.scala
def head[A]: A

First element

First element

Returns first elements or fails for empty Idx

Use head_? for safer access

Source
__.scala
@scala.annotation.targetName("head_Opt")
def head_?[A]: Opt[A]

First optional element

First optional element

Returns first elements or empty option for empty Idx

Source
__.scala
def last[A]: A
Source
__.scala
@scala.annotation.targetName("last_Opt")
def last_?[A]: Opt[A]
Source
__.scala
@scala.annotation.targetName("map_View")
def map_^[A](f: A => B): Idx[B]
Source
__.scala
def orderedContains[A](v: A)(using scala.Ordering[A]): Boolean
Source
__.scala
def orderedSearch[A](v: A, max: Int)(using scala.Ordering[A]): Int.<>
Source
__.scala
def orderedSearchBy[A](map: A => B, v: B, max: Int, extraFilter: A => Boolean)(using scala.Ordering[B]): Int.<>
Source
__.scala
@scala.annotation.targetName("range_View")
def range_^[A](r: Int.<>): Idx[A]
Source
__.scala
@scala.annotation.targetName("readOnly_View")
def readOnly_^[A]: Idx[A]
Source
__.scala
@scala.annotation.targetName("reversed_View")
def reversed_^[A]: Idx[A]
Source
__.scala
def tail[A]: Idx[A]

Idx without first element

Idx without first element

The returned tail can be empty

Note. This operation creates a tail "view" of target Idx, so target mutations may cause problem

Source
__.scala
@scala.annotation.targetName("toJavaList_View")
def toJavaList_^[A]: java.util.List[A]
Source
__.scala
@scala.annotation.targetName("toProduct_View")
def toProduct_^[A]: scala.Product
Source
__.scala
@scala.annotation.targetName("toSeq_View")
def toSeq_^[A]: scala.collection.immutable.IndexedSeq[A]
Source
__.scala