Extensions

narr.native.Extensions
object Extensions

Attributes

Source
Extensions.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Extensions.type

Members list

Givens

Givens

given orderingToCompareFunction[T]: orderingToCompareFunction[T]

Attributes

Source
Extensions.scala

Extensions

Extensions

extension (a: ByteArray)
inline def head: Byte

Attributes

Source
Extensions.scala
def sort(): ByteArray

Attributes

Source
Extensions.scala
def sort(ord: Ordering[Byte]): ByteArray

Attributes

Source
Extensions.scala

Attributes

Source
Extensions.scala
def sorted(ord: Ordering[Byte]): ByteArray

Attributes

Source
Extensions.scala
extension (a: ShortArray)
inline def head: Short

Attributes

Source
Extensions.scala
def sort(): ShortArray

Attributes

Source
Extensions.scala
def sort(ord: Ordering[Short]): ShortArray

Attributes

Source
Extensions.scala

Attributes

Source
Extensions.scala
def sorted(ord: Ordering[Short]): ShortArray

Attributes

Source
Extensions.scala
extension (a: IntArray)
def sort(): IntArray

Attributes

Source
Extensions.scala
def sort(ord: Ordering[Int]): IntArray

Attributes

Source
Extensions.scala

Attributes

Source
Extensions.scala
def sorted(ord: Ordering[Int]): IntArray

Attributes

Source
Extensions.scala
extension (a: FloatArray)
def sort(): FloatArray

Attributes

Source
Extensions.scala
def sort(ord: Ordering[Float]): FloatArray

Attributes

Source
Extensions.scala

Attributes

Source
Extensions.scala
def sorted(ord: Ordering[Float]): FloatArray

Attributes

Source
Extensions.scala
extension (a: DoubleArray)
def sort(): DoubleArray

Attributes

Source
Extensions.scala
def sort(ord: Ordering[Double]): DoubleArray

Attributes

Source
Extensions.scala

Attributes

Source
Extensions.scala
def sorted(ord: Ordering[Double]): DoubleArray

Attributes

Source
Extensions.scala
extension [T](a: NArray[T])
inline def ++[B >: T : ClassTag](xs: NArray[B]): NArray[B]

Attributes

Source
Extensions.scala
inline def :++[B >: T : ClassTag](suffix: NArray[B]): NArray[B]

Attributes

Source
Extensions.scala
inline def appendedAll[B >: T : ClassTag](suffix: NArray[B]): NArray[B]

A copy of this array with all elements of an array appended.

A copy of this array with all elements of an array appended.

Attributes

Source
Extensions.scala
inline def concat[B >: T : ClassTag](suffix: NArray[B]): NArray[B]

Attributes

Source
Extensions.scala
def contains(elem: T): Boolean

Tests whether this array contains a given value as an element.

Tests whether this array contains a given value as an element.

Value parameters

elem

the element to test.

Attributes

Returns

true if this array has an element that is equal (as determined by ==) to elem, false otherwise.

Source
Extensions.scala
inline def copy: NArray[T]

Attributes

Source
Extensions.scala
inline def drop(n: Int): NArray[T]

The rest of the NArray without its n first elements.

The rest of the NArray without its n first elements.

Attributes

Source
Extensions.scala
inline def dropRight(n: Int): NArray[T]

The rest of the NArray without its n last elements.

The rest of the NArray without its n last elements.

Attributes

Source
Extensions.scala
inline def dropWhile(p: T => Boolean): NArray[T]

Drops longest prefix of elements that satisfy a predicate.

Drops longest prefix of elements that satisfy a predicate.

Value parameters

p

The predicate used to test ele nts.

Attributes

Returns

the longest suffix of this NArray whose first element does not satisfy the predicate p.

Source
Extensions.scala
def exists(p: T => Boolean): Boolean

Tests whether a predicate holds for at least one element of this array.

Tests whether a predicate holds for at least one element of this array.

Value parameters

p

the predicate used to test elements.

Attributes

Returns

true if the given predicate p is satisfied by at least one element of this array, otherwise false

Source
Extensions.scala
def find(p: T => Boolean): Option[T]

Finds the first element of the array satisfying a predicate, if any.

Finds the first element of the array satisfying a predicate, if any.

Value parameters

p

the predicate used to test elements.

Attributes

Returns

an option value containing the first element in the array that satisfies p, or None if none exists.

Source
Extensions.scala
def forall(p: T => Boolean): Boolean

Tests whether a predicate holds for all elements of this array.

Tests whether a predicate holds for all elements of this array.

Value parameters

p

the predicate used to test elements.

Attributes

Returns

true if this array is empty or the given predicate p holds for all elements of this array, otherwise false.

Source
Extensions.scala
def foreach[U](f: T => U): Unit

Apply f to each element for side effects. Note: [U] parameter needed to help scalac' pe ference.

Apply f to each element for side effects. Note: [U] parameter needed to help scalac' pe ference.

Attributes

Source
Extensions.scala
inline def head: T

Attributes

Source
Extensions.scala
inline def headOption: Option[T]

Optionally selects the first element.

Optionally selects the first element.

Attributes

Returns

the first element of this NArray if it is nonempty, None if it is empty.

Source
Extensions.scala
inline def indexOf(elem: T): Int

Finds index of first occurrence of some value in this array.

Finds index of first occurrence of some value in this array.

Value parameters

elem

the element value to search for.

Attributes

Returns

the index >= from of the first element of this array that is equal (as determined by ==) to elem, or -1, if none exists.

Source
Extensions.scala
def indexOf(elem: T, from: Int): Int

Finds index of first occurrence of some value in this array after or at some start index.

Finds index of first occurrence of some value in this array after or at some start index.

Value parameters

elem

the element value to search for.

from

the start index

Attributes

Returns

the index >= from of the first element of this array that is equal (as determined by ==) to elem, or -1, if none exists.

Source
Extensions.scala
inline def indexWhere(p: T => Boolean): Int

Finds index of the first element satisfying some predicate.

Finds index of the first element satisfying some predicate.

Value parameters

p

the predicate used to test elements.

Attributes

Returns

the index >= 0 of the first element of this array that satisfies the predicate p, or -1, if none exists.

Source
Extensions.scala
def indexWhere(p: T => Boolean, from: Int): Int

Finds index of the first element satisfying some predicate after or at some start index.

Finds index of the first element satisfying some predicate after or at some start index.

Value parameters

from

the start index

p

the predicate used to test elements.

Attributes

Returns

the index >= from of the first element of this array that satisfies the predicate p, or -1, if none exists.

Source
Extensions.scala
inline def indices: Range

Produces the range of all indices of this sequence.

Produces the range of all indices of this sequence.

Attributes

Returns

a Range value from 0 to one less than the length of this array.

Source
Extensions.scala
inline def init: NArray[T]

The initial part of the NArray without its last element.

The initial part of the NArray without its last element.

Attributes

Source
Extensions.scala
inline def isEmpty: Boolean

Tests whether the NArray is empty.

Tests whether the NArray is empty.

Attributes

Returns

true if the NArray contains no elements, false otherwise.

Source
Extensions.scala
inline def iterator: Iterator[T]

Attributes

Returns

an iterator for this AT

Source
Extensions.scala
inline def knownSize: Int

The size of this NArray.

The size of this NArray.

Attributes

Returns

the number of elements in this NArray.

Source
Extensions.scala
inline def last: T

Attributes

Source
Extensions.scala
inline def lastIndexOf(elem: T): Int

Finds index of last occurrence of some value in this array.

Finds index of last occurrence of some value in this array.

Value parameters

elem

the element value to search for.

Attributes

Returns

the index <= length - 1 of the last element of this array that is equal (as determined by ==) to elem, or -1, if none exists.

Source
Extensions.scala
def lastIndexOf(elem: T, end: Int): Int

Finds index of last occurrence of some value in this array before or at a given end index.

Finds index of last occurrence of some value in this array before or at a given end index.

Value parameters

elem

the element value to search for.

end

the end index.

Attributes

Returns

the index <= end of the last element of this array that is equal (as determined by ==) to elem, or -1, if none exists.

Source
Extensions.scala
inline def lastIndexWhere(p: T => Boolean): Int

Finds index of last element satisfying some predicate.

Finds index of last element satisfying some predicate.

Value parameters

p

the predicate used to test elements.

Attributes

Returns

the index of the last element of this array that satisfies the predicate p, or -1, if none exists.

Source
Extensions.scala
def lastIndexWhere(p: T => Boolean, end: Int): Int

Finds index of last element satisfying some predicate before or at given end index.

Finds index of last element satisfying some predicate before or at given end index.

Value parameters

p

the predicate used to test elements.

Attributes

Returns

the index <= end of the last element of this array that satisfies the predicate p, or -1, if none exists.

Source
Extensions.scala
inline def lastOption: Option[T]

Optionally selects the last element.

Optionally selects the last element.

Attributes

Returns

the last element of this NArray$ if it is nonempty, None if it is empty.

Source
Extensions.scala
inline def lengthCompare(len: Int): Int

Compares the length of this NArray to a test value. *

Compares the length of this NArray to a test value. *

Attributes

Source
Extensions.scala
inline def lengthIs: Int

Method mirroring SeqOps.lengthIs for consistency, except it returns an Int because length is known and comparison is constant-time.

Method mirroring SeqOps.lengthIs for consistency, except it returns an Int because length is known and comparison is constant-time.

These operations are equivalent to `lengthCompare(Int)`, and allow the following more readable usages:

this.lengthIs < len     // this.lengthCompare(len) < 0
this.lengthIs <= len    // this.lengthCompare(len) <= 0
this.lengthIs == len    // this.lengthCompare(len) == 0
this.lengthIs != len    // this.lengthCompare(len) != 0
this.lengthIs >= len    // this.lengthCompare(len) >= 0
this.lengthIs > len     // this.lengthCompare(len) > 0

Attributes

Source
Extensions.scala
def map[B : ClassTag](f: T => B): NArray[B]

Builds a new array by applying a function to all elements of this array.

Builds a new array by applying a function to all elements of this array.

Type parameters

B

the element type of the returned array.

Value parameters

f

the function to apply to each element.

Attributes

Returns

a new array resulting from applying the given function f to each element of this array and collecting the results.

Source
Extensions.scala
def mapInPlace(f: T => T): NArray[T]

Maps each element of this array to a new element of the same type. This 'in place' operation overwrites the original data.

Maps each element of this array to a new element of the same type. This 'in place' operation overwrites the original data.

Value parameters

f

the function to apply to each element.

Attributes

Returns

a reference to this array, after mapping took place.

Source
Extensions.scala
inline def nonEmpty: Boolean

Tests whether the NArray is not empty.

Tests whether the NArray is not empty.

Attributes

Returns

true if the NArray contains at least one element, false otherwise.

Source
Extensions.scala
def reverse: NArray[T]

Returns a new array with the elements in reversed order.

Returns a new array with the elements in reversed order.

Attributes

Source
Extensions.scala
inline def reverseIterator: Iterator[T]

An iterator yielding elements in reversed order.

An iterator yielding elements in reversed order.

Note: xs.reverseIterator is the same as xs.reverse.iterator but implemented more efficiently.

Attributes

Returns

an iterator yielding the elements of this array in reversed order

Source
Extensions.scala
inline def size: Int

The size of this NArray.

The size of this NArray.

Attributes

Returns

the number of elements in this NArray.

Source
Extensions.scala
inline def sizeCompare(otherSize: Int): Int

Compares the size of this NArray to a test value.

Compares the size of this NArray to a test value.

Value parameters

otherSize

the test value that gets compared with the size.

Attributes

Returns

A value x where

      x <  0       if this.size <  otherSize
      x == 0       if this.size == otherSize
      x >  0       if this.size >  otherSize
Source
Extensions.scala
inline def sizeIs: Int

Method mirroring SeqOps.sizeIs for consistency, except it returns an Int because size is known and comparison is constant-time.

Method mirroring SeqOps.sizeIs for consistency, except it returns an Int because size is known and comparison is constant-time.

These operations are equivalent to `sizeCompare(Int)`, and allow the following more readable usages:

this.sizeIs < size     // this.sizeCompare(size) < 0
this.sizeIs <= size    // this.sizeCompare(size) <= 0
this.sizeIs == size    // this.sizeCompare(size) == 0
this.sizeIs != size    // this.sizeCompare(size) != 0
this.sizeIs >= size    // this.sizeCompare(size) >= 0
this.sizeIs > size     // this.sizeCompare(size) > 0

Attributes

Source
Extensions.scala
inline def slice(from: Int): NArray[T]

Selects an interval of elements. The returned array is made up of all elements x which satisfy the invariant:

Selects an interval of elements. The returned array is made up of all elements x which satisfy the invariant:

 from <= indexOf(x) < until

Value parameters

from

the lowest index to include from this array.

Attributes

Returns

an array containing the elements greater than or equal to index from extending through the end of this array.

Source
Extensions.scala
inline def slice(from: Int, until: Int): NArray[T]

Selects an interval of elements. The returned array is made up of all elements x which satisfy the invariant:

Selects an interval of elements. The returned array is made up of all elements x which satisfy the invariant:

 from <= indexOf(x) < until

Value parameters

from

the lowest index to include from this array.

until

the lowest index to EXCLUDE from this array.

Attributes

Returns

an array containing the elements greater than or equal to index from extending up to (but not including) index until of this array.

Source
Extensions.scala
def sortBy[B](f: T => B)(implicit ord: Ordering[B]): NArray[T]

Sorts this array according to the Ordering which results from transforming an implicitly given Ordering with a transformation function.

Sorts this array according to the Ordering which results from transforming an implicitly given Ordering with a transformation function.

Type parameters

B

the target type of the transformation f, and the type where the ordering ord is defined.

Value parameters

f

the transformation function mapping elements to some other domain B.

ord

the ordering assumed on domain B.

Attributes

Returns

an array consisting of the elements of this array sorted according to the ordering where x < y if ord.lt(f(x), f(y)).

See also

scala.math.Ordering

Source
Extensions.scala
def sortWith(lt: (T, T) => Boolean): NArray[T]

Sorts this array according to a comparison function.

Sorts this array according to a comparison function.

The sort is stable. That is, elements that are equal (as determined by lt) appear in the same order in the sorted sequence as in the original.

Value parameters

lt

the comparison function which tests whether its first argument precedes its second argument in the desired ordering.

Attributes

Returns

an array consisting of the elements of this array sorted according to the comparison function lt.

Source
Extensions.scala
def splitAt(n: Int): (NArray[T], NArray[T])

Splits this array into two at a given position. Note: c splitAt n is equivalent to (c take n, c drop n).

Splits this array into two at a given position. Note: c splitAt n is equivalent to (c take n, c drop n).

Value parameters

n

the position at which to split.

Attributes

Returns

a pair of arrays consisting of the first n elements of this array, and the other elements.

Source
Extensions.scala
inline def tail: NArray[T]

The rest of the NArray without its first element.

The rest of the NArray without its first element.

Attributes

Source
Extensions.scala
inline def take(n: Int): NArray[T]

An NArray containing the first n elements of this NArray.

An NArray containing the first n elements of this NArray.

Attributes

Source
Extensions.scala
inline def takeRight(n: Int): NArray[T]

An NArray containing the last n elements of this NArray.

An NArray containing the last n elements of this NArray.

Attributes

Source
Extensions.scala
inline def takeWhile(p: T => Boolean): NArray[T]

Takes longest prefix of elements that satisfy a predicate.

Takes longest prefix of elements that satisfy a predicate.

Value parameters

p

The predicate used to test ele nts.

Attributes

Returns

the longest prefix of this NArray whose elements all satisfy the predicate p.

Source
Extensions.scala
def zipWithIndex: Array[(T, Int)]

Zips this array with its indices.

Zips this array with its indices.

Attributes

Returns

A new array containing pairs consisting of all elements of this array paired with their index. Indices start at 0.

Source
Extensions.scala