IArray
An immutable array.
An immutable array. An IArray[T]
has the same representation as an Array[T]
,
but it cannot be updated. Unlike regular arrays, immutable arrays are covariant.
Type members
Value members
Concrete methods
Concatenates all arrays into a single immutable array.
Concatenates all arrays into a single immutable array.
- Value Params
- xss
the given immutable arrays
- Returns
the array created from concatenating
xss
Compare two arrays per element.
Compare two arrays per element.
A more efficient version of xs.sameElements(ys)
.
- Value Params
- xs
an array of AnyRef
- ys
an array of AnyRef
- Returns
true if corresponding elements are equal
Returns an immutable array that contains the results of some element computation a number of times.
Returns an immutable array that contains the results of some element computation a number of times. Each element is determined by a separate computation.
- Value Params
- elem
the element computation
- n
the number of elements in the array
Returns a two-dimensional immutable array that contains the results of some element computation a number of times.
Returns a two-dimensional immutable array that contains the results of some element computation a number of times. Each element is determined by a separate computation.
- Value Params
- elem
the element computation
- n1
the number of elements in the 1st dimension
- n2
the number of elements in the 2nd dimension
Returns a three-dimensional immutable array that contains the results of some element computation a number of times.
Returns a three-dimensional immutable array that contains the results of some element computation a number of times. Each element is determined by a separate computation.
- Value Params
- elem
the element computation
- n1
the number of elements in the 1st dimension
- n2
the number of elements in the 2nd dimension
- n3
the number of elements in the 3nd dimension
Returns a four-dimensional immutable array that contains the results of some element computation a number of times.
Returns a four-dimensional immutable array that contains the results of some element computation a number of times. Each element is determined by a separate computation.
- Value Params
- elem
the element computation
- n1
the number of elements in the 1st dimension
- n2
the number of elements in the 2nd dimension
- n3
the number of elements in the 3nd dimension
- n4
the number of elements in the 4th dimension
Returns a five-dimensional immutable array that contains the results of some element computation a number of times.
Returns a five-dimensional immutable array that contains the results of some element computation a number of times. Each element is determined by a separate computation.
- Value Params
- elem
the element computation
- n1
the number of elements in the 1st dimension
- n2
the number of elements in the 2nd dimension
- n3
the number of elements in the 3nd dimension
- n4
the number of elements in the 4th dimension
- n5
the number of elements in the 5th dimension
Build an array from the iterable collection.
Build an array from the iterable collection.
scala> val a = IArray.from(Seq(1, 5))
val a: IArray[Int] = IArray(1, 5)
scala> val b = IArray.from(Range(1, 5))
val b: IArray[Int] = IArray(1, 2, 3, 4)
- Value Params
- it
the iterable collection
- Returns
an array consisting of elements of the iterable collection
Returns an immutable array containing repeated applications of a function to a start value.
Returns an immutable array containing repeated applications of a function to a start value.
- Value Params
- f
the function that is repeatedly applied
- len
the number of elements returned by the array
- start
the start value of the array
- Returns
the immutable array returning
len
values in the sequencestart, f(start), f(f(start)), ...
Returns an immutable array containing a sequence of increasing integers in a range.
Returns an immutable array containing a sequence of increasing integers in a range.
- Value Params
- end
the end value of the array, exclusive (in other words, this is the first value not returned)
- start
the start value of the array
- Returns
the immutable array with values in range
start, start + 1, ..., end - 1
up to, but excluding,end
.
Returns an immutable array containing equally spaced values in some integer interval.
Returns an immutable array containing equally spaced values in some integer interval.
- Value Params
- end
the end value of the array, exclusive (in other words, this is the first value not returned)
- start
the start value of the array
- step
the increment value of the array (may not be zero)
- Returns
the immutable array with values in
start, start + step, ...
up to, but excludingend
Returns an immutable array containing values of a given function over a range of integer values starting from 0.
Returns an immutable array containing values of a given function over a range of integer values starting from 0.
- Value Params
- f
The function computing element values
- n
The number of elements in the array
Returns a two-dimensional immutable array containing values of a given function
over ranges of integer values starting from 0
.
Returns a two-dimensional immutable array containing values of a given function
over ranges of integer values starting from 0
.
- Value Params
- f
The function computing element values
- n1
the number of elements in the 1st dimension
- n2
the number of elements in the 2nd dimension
Returns a three-dimensional immutable array containing values of a given function
over ranges of integer values starting from 0
.
Returns a three-dimensional immutable array containing values of a given function
over ranges of integer values starting from 0
.
- Value Params
- f
The function computing element values
- n1
the number of elements in the 1st dimension
- n2
the number of elements in the 2nd dimension
- n3
the number of elements in the 3rd dimension
Returns a four-dimensional immutable array containing values of a given function
over ranges of integer values starting from 0
.
Returns a four-dimensional immutable array containing values of a given function
over ranges of integer values starting from 0
.
- Value Params
- f
The function computing element values
- n1
the number of elements in the 1st dimension
- n2
the number of elements in the 2nd dimension
- n3
the number of elements in the 3rd dimension
- n4
the number of elements in the 4th dimension
Returns a five-dimensional immutable array containing values of a given function
over ranges of integer values starting from 0
.
Returns a five-dimensional immutable array containing values of a given function
over ranges of integer values starting from 0
.
- Value Params
- f
The function computing element values
- n1
the number of elements in the 1st dimension
- n2
the number of elements in the 2nd dimension
- n3
the number of elements in the 3rd dimension
- n4
the number of elements in the 4th dimension
- n5
the number of elements in the 5th dimension
Returns a decomposition of the array into a sequence.
Returns a decomposition of the array into a sequence. This supports
a pattern match like { case IArray(x,y,z) => println('3 elements')}
.
- Value Params
- x
the selector value
- Returns
sequence wrapped in a scala.Some, if
x
is a Seq, otherwiseNone
Convert an array into an immutable array without copying, the original array must _not_ be mutated after this or the guaranteed immutablity of IArray will be violated.
Convert an array into an immutable array without copying, the original array must _not_ be mutated after this or the guaranteed immutablity of IArray will be violated.