_methods

trait _methods

Array Extension Methods

Extension methods are universaly avaialble for all Array types.

The methods are heavily overloaded to work efficiently when array type is explicit, but they fall back on slower inmpementations when array is generic.

Source
_methods.scala
class java.lang.Object
trait scala.Matchable
class Any

Def

@scala.annotation.targetName("stream")
inline def ~[A, STREAM <: ~~.AnyType[A]](using inline t: Given.StreamTag[A, Array._methods.STREAM]): STREAM & Able.Size

Elements stream

Elements stream

Returns stream of array elements

Source
_methods.scala
@scala.annotation.targetName("stream")
inline def ~[A, STREAM <: ~~.AnyType[A]](inline sz: Int)(using inline t: Given.StreamTag[A, Array._methods.STREAM]): STREAM & Able.Size

Sized stream

Sized stream

Returns stream of array elements limited to given size

Source
_methods.scala
@scala.annotation.targetName("_join")
inline def +[A, ARR <: Array.AnyType[A]](inline v: A)(using inline t: Given.ArrayTag[A, ARR]): ARR

Shortcut to 'join'

Shortcut to 'join'

Copies base array to a new array with given element appended

Source
_methods.scala
@scala.annotation.targetName("_joinAll")
inline def ++[A, ARR <: Array.AnyType[A]](inline v: ~[A])(using inline t: Given.ArrayTag[A, ARR]): ARR

Shortcut to 'joinAll'

Shortcut to 'joinAll'

Copies base array to a new array with given stream of elements appended

Source
_methods.scala
@scala.annotation.targetName("_joinAllAt")
inline def ++@[A, ARR <: Array.AnyType[A]](inline i: Int, inline v: ~[A])(using inline t: Given.ArrayTag[A, ARR]): ARR

Shortcut to 'joinAllAt'

Shortcut to 'joinAllAt'

Copies base array to a new array with given stream of elements inserted at given position

Source
_methods.scala
@scala.annotation.targetName("_joinAt")
inline def +@[A, ARR <: Array.AnyType[A]](inline i: Int, inline v: A)(using inline t: Given.ArrayTag[A, ARR]): ARR

Shortcut to 'joinAt'

Shortcut to 'joinAt'

Copies base array to a new array with given element inserted at given position

Source
_methods.scala
@scala.annotation.targetName("pack")
inline def ><[A, PACK <: ><.AnyType[A]](using inline t: Given.PackTag[A, Array._methods.PACK]): PACK
inline def contains[A, ARR <: Array.AnyType[A]](inline v: A)(using inline t: Given.ArrayTag[A, ARR]): Boolean

Contains check

Contains check

Returns true if array contains equal value, `false - otherwise

Source
_methods.scala
inline def copySize[A, ARR <: Array.AnyType[A]](inline size: Int)(using inline t: Given.ArrayTag[A, ARR]): ARR

Copy with new size

Copy with new size

Creates new Array of specified size (can be larger or smaller), with appropriate elements copied from base array

Source
_methods.scala
inline def copyTo[A](a: Array[A]): Unit

Copy to array

Copy to array

Copies base array elements to given array

Note. Efficient JVM System.arraycopy method is used

Source
_methods.scala
inline def copyTo[A](a: Array[A], pos: Int): Unit

Copy to array

Copy to array

Copies base array elements to given array, starting at given position

Note. Efficient JVM System.arraycopy method is used

Source
_methods.scala
inline def copyTo[A](inline a: Array[A], inline pos: Int, inline from: Int, inline size: Int): Unit

Copy to array

Copy to array

Copies base array elements to given array, starting at given 'pos'

'from' and 'size' specify base array range to be copied

Note. Efficient JVM System.arraycopy method is used

Source
_methods.scala
@scala.annotation.targetName("drop_Range")
inline def drop_<>[A, ARR <: Array.AnyType[A]](inline start: Int, inline size: Int)(using inline t: Given.ArrayTag[A, ARR]): ARR

Drop range

Drop range

Copies base array to a new array without elements of specified range

Source
_methods.scala
@scala.annotation.targetName("drop_Range")
inline def drop_<>[A, ARR <: Array.AnyType[A]](r: Int.<>)(using inline t: Given.ArrayTag[A, ARR]): ARR

Drop range

Drop range

Copies base array to a new array without elements of specified range

Source
_methods.scala
inline def fill[A, ARR <: Array.AnyType[A]](inline v: A)(using inline t: Given.ArrayTag[A, ARR]): Unit

Fill value

Fill value

Assigns given value to all base array positions

Source
_methods.scala
@scala.annotation.targetName("fill_Range")
inline def fill_<>[A, ARR <: Array.AnyType[A]](inline start: Int, inline size: Int, inline v: A)(using inline t: Given.ArrayTag[A, ARR]): Unit

Fill range with value

Fill range with value

Assigns given value to base array positions within given range

Source
_methods.scala
@scala.annotation.targetName("fill_Range")
inline def fill_<>[A, ARR <: Array.AnyType[A]](r: Int.<>, inline v: A)(using inline t: Given.ArrayTag[A, ARR]): Unit

Fill range with value

Fill range with value

Assigns given value to base array positions within given range

Source
_methods.scala
inline def join[A, ARR <: Array.AnyType[A]](inline v: A)(using inline t: Given.ArrayTag[A, ARR]): ARR

Join element

Join element

Copies base array to a new array with given element appended

Source
_methods.scala
inline def joinAll[A, ARR <: Array.AnyType[A]](inline v: ~[A])(using inline t: Given.ArrayTag[A, ARR]): ARR

Join multiple elements

Join multiple elements

Copies base array to a new array with given stream of elements appended

Source
_methods.scala
inline def joinAllAt[A, ARR <: Array.AnyType[A]](inline i: Int, inline v: ~[A])(using inline t: Given.ArrayTag[A, ARR]): ARR

Join multiple elements at position

Join multiple elements at position

Copies base array to a new array with given stream of elements inserted at given position

Source
_methods.scala
inline def joinAt[A, ARR <: Array.AnyType[A]](inline i: Int, inline v: A)(using inline t: Given.ArrayTag[A, ARR]): ARR

Join element at position

Join element at position

Copies base array to a new array with given element inserted at given position

Source
_methods.scala
inline def newArray[A, ARR <: Array.AnyType[A]](inline size: Int)(using inline t: Given.ArrayTag[A, ARR]): ARR

New Array

New Array

Creates new empty array of the same type as base array, but with given size

Source
_methods.scala
inline def sort[A, ARR <: Array.AnyType[A]](using inline c: scala.Ordering[A])(using inline t: Given.ArrayTag[A, ARR]): Unit

Sort array

Sort array

Sorts array elements

Source
_methods.scala
@scala.annotation.targetName("sort_Range")
inline def sort_<>[A, ARR <: Array.AnyType[A]](inline start: Int, inline size: Int)(using inline c: scala.Ordering[A])(using inline t: Given.ArrayTag[A, ARR]): Unit

Sort array range

Sort array range

Sorts array elements within given range

Source
_methods.scala
@scala.annotation.targetName("sort_Range")
inline def sort_<>[A, ARR <: Array.AnyType[A]](r: Int.<>)(using inline c: scala.Ordering[A])(using inline t: Given.ArrayTag[A, ARR]): Unit

Sort array range

Sort array range

Sorts array elements within given range

Source
_methods.scala
@scala.annotation.targetName("take_Range")
inline def take_<>[A, ARR <: Array.AnyType[A]](inline start: Int, inline size: Int)(using inline t: Given.ArrayTag[A, ARR]): ARR

Take range

Take range

Copies given range of elements a new array

Source
_methods.scala
@scala.annotation.targetName("take_Range")
inline def take_<>[A, ARR <: Array.AnyType[A]](r: Int.<>)(using inline t: Given.ArrayTag[A, ARR]): ARR

Take range

Take range

Copies given range of elements a new array

Source
_methods.scala