scala

object Array

[source: scala/Array.scala]

object Array
extends FallbackArrayBuilding
This object contains utility methods operating on arrays.
Author
Martin Odersky
Version
1.0
Method Summary
def apply (x : Short, xs : Short*) : Array[Short]
def apply (x : Char, xs : Char*) : Array[Char]
def apply (x : Int, xs : Int*) : Array[Int]
def apply (x : Float, xs : Float*) : Array[Float]
def apply (x : Long, xs : Long*) : Array[Long]
def apply (x : Byte, xs : Byte*) : Array[Byte]
def apply (x : Double, xs : Double*) : Array[Double]
def apply (x : Unit, xs : Unit*) : Array[Unit]
def apply [T](xs : T*)(implicit evidence$2 : ClassManifest[T]) : Array[T]
Create an array with given elements.
def apply (x : Boolean, xs : Boolean*) : Array[Boolean]
implicit def canBuildFrom [T](implicit m : ClassManifest[T]) : CanBuildFrom[Array[Any], T, Array[T]]
def concat [T](xss : Array[T]*)(implicit evidence$8 : ClassManifest[T]) : Array[T]
Concatenate all argument sequences into a single array.
def copy (src : AnyRef, srcPos : Int, dest : AnyRef, destPos : Int, length : Int) : Unit
Copy one array to another. Equivalent to System.arraycopy(src, srcPos, dest, destPos, length), except that this works also for polymorphic and boxed arrays.
def empty [T](implicit evidence$1 : ClassManifest[T]) : Array[T]
Returns array of length 0
def fill [T](n : Int)(elem : => T)(implicit evidence$9 : ClassManifest[T]) : Array[T]
An array that contains the results of some element computation a number of times.
def fill [T](n1 : Int, n2 : Int, n3 : Int, n4 : Int, n5 : Int)(elem : => T)(implicit evidence$13 : ClassManifest[T]) : Array[Array[Array[Array[Array[T]]]]]
A five-dimensional array that contains the results of some element computation a number of times.
def fill [T](n1 : Int, n2 : Int)(elem : => T)(implicit evidence$10 : ClassManifest[T]) : Array[Array[T]]
A two-dimensional array that contains the results of some element computation a number of times.
def fill [T](n1 : Int, n2 : Int, n3 : Int, n4 : Int)(elem : => T)(implicit evidence$12 : ClassManifest[T]) : Array[Array[Array[Array[T]]]]
A four-dimensional array that contains the results of some element computation a number of times.
def fill [T](n1 : Int, n2 : Int, n3 : Int)(elem : => T)(implicit evidence$11 : ClassManifest[T]) : Array[Array[Array[T]]]
A three-dimensional array that contains the results of some element computation a number of times.
def fromFunction [T](f : (Int, Int, Int) => T)(n1 : Int, n2 : Int, n3 : Int)(implicit evidence$23 : ClassManifest[T]) : Array[Array[Array[T]]]
Create an array containing the values of a given function f over given range [0..n1, 0..n2, 0..n3)
def fromFunction [T](f : (Int, Int, Int, Int, Int) => T)(n1 : Int, n2 : Int, n3 : Int, n4 : Int, n5 : Int)(implicit evidence$25 : ClassManifest[T]) : Array[Array[Array[Array[Array[T]]]]]
Create an array containing the values of a given function f over given range [0..n1, 0..n2, 0..n3, 0..n4, 0..n5)
def fromFunction [T](f : (Int, Int) => T)(n1 : Int, n2 : Int)(implicit evidence$22 : ClassManifest[T]) : Array[Array[T]]
Create an array containing the values of a given function f over given range [0..n1, 0..n2)
def fromFunction [T](f : (Int) => T)(n : Int)(implicit evidence$21 : ClassManifest[T]) : Array[T]
Create an array containing the values of a given function f over given range [0..n)
def fromFunction [T](f : (Int, Int, Int, Int) => T)(n1 : Int, n2 : Int, n3 : Int, n4 : Int)(implicit evidence$24 : ClassManifest[T]) : Array[Array[Array[Array[T]]]]
Create an array containing the values of a given function f over given range [0..n1, 0..n2, 0..n3, 0..n4)
def iterate [T](start : T, len : Int)(f : (T) => T)(implicit evidence$19 : ClassManifest[T]) : Array[T]
An array containing repeated applications of a function to a start value.
def make [T](n : Int, elem : T)(implicit evidence$20 : ClassManifest[T]) : Array[T]
Create an array containing several copies of an element.
def newBuilder [T](implicit m : ClassManifest[T]) : ArrayBuilder[T]
def ofDim [T](n1 : Int, n2 : Int, n3 : Int, n4 : Int)(implicit evidence$6 : ClassManifest[T]) : Array[Array[Array[Array[T]]]]
def ofDim [T](n1 : Int)(implicit evidence$3 : ClassManifest[T]) : Array[T]
Create array with given dimensions
def ofDim [T](n1 : Int, n2 : Int)(implicit evidence$4 : ClassManifest[T]) : Array[Array[T]]
def ofDim [T](n1 : Int, n2 : Int, n3 : Int, n4 : Int, n5 : Int)(implicit evidence$7 : ClassManifest[T]) : Array[Array[Array[Array[Array[T]]]]]
def ofDim [T](n1 : Int, n2 : Int, n3 : Int)(implicit evidence$5 : ClassManifest[T]) : Array[Array[Array[T]]]
def range (start : Int, end : Int, step : Int) : Array[Int]
An array containing equally spaced values in some integer interval.
def range (start : Int, end : Int) : Array[Int]
An array containing a sequence of increasing integers in a range.
def tabulate [T](n1 : Int, n2 : Int, n3 : Int, n4 : Int)(f : (Int, Int, Int, Int) => T)(implicit evidence$17 : ClassManifest[T]) : Array[Array[Array[Array[T]]]]
A four-dimensional array containing values of a given function over ranges of integer values starting from 0.
def tabulate [T](n1 : Int, n2 : Int)(f : (Int, Int) => T)(implicit evidence$15 : ClassManifest[T]) : Array[Array[T]]
A two-dimensional array containing values of a given function over ranges of integer values starting from 0.
def tabulate [T](n1 : Int, n2 : Int, n3 : Int)(f : (Int, Int, Int) => T)(implicit evidence$16 : ClassManifest[T]) : Array[Array[Array[T]]]
A three-dimensional array containing values of a given function over ranges of integer values starting from 0.
def tabulate [T](n1 : Int, n2 : Int, n3 : Int, n4 : Int, n5 : Int)(f : (Int, Int, Int, Int, Int) => T)(implicit evidence$18 : ClassManifest[T]) : Array[Array[Array[Array[Array[T]]]]]
A five-dimensional array containing values of a given function over ranges of integer values starting from 0.
def tabulate [T](n : Int)(f : (Int) => T)(implicit evidence$14 : ClassManifest[T]) : Array[T]
An array containing values of a given function over a range of integer values starting from 0.
def unapplySeq [T](x : Array[T]) : Option[IndexedSeq[T]]
This method is called in a pattern match { case Seq(...) => }.
Methods inherited from FallbackArrayBuilding
fallbackCanBuildFrom
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
implicit def canBuildFrom[T](implicit m : ClassManifest[T]) : CanBuildFrom[Array[Any], T, Array[T]]

def newBuilder[T](implicit m : ClassManifest[T]) : ArrayBuilder[T]

def copy(src : AnyRef, srcPos : Int, dest : AnyRef, destPos : Int, length : Int) : Unit
Copy one array to another. Equivalent to System.arraycopy(src, srcPos, dest, destPos, length), except that this works also for polymorphic and boxed arrays.
Parameters
src - ...
srcPos - ...
dest - ...
destPos - ...
length - ...

def empty[T](implicit evidence$1 : ClassManifest[T]) : Array[T]
Returns array of length 0

def apply[T](xs : T*)(implicit evidence$2 : ClassManifest[T]) : Array[T]
Create an array with given elements.
Parameters
xs - the elements to put in the array
Returns
the array containing elements xs.

def apply(x : Boolean, xs : Boolean*) : Array[Boolean]

def apply(x : Byte, xs : Byte*) : Array[Byte]

def apply(x : Short, xs : Short*) : Array[Short]

def apply(x : Char, xs : Char*) : Array[Char]

def apply(x : Int, xs : Int*) : Array[Int]

def apply(x : Long, xs : Long*) : Array[Long]

def apply(x : Float, xs : Float*) : Array[Float]

def apply(x : Double, xs : Double*) : Array[Double]

def apply(x : Unit, xs : Unit*) : Array[Unit]

def ofDim[T](n1 : Int)(implicit evidence$3 : ClassManifest[T]) : Array[T]
Create array with given dimensions

def ofDim[T](n1 : Int, n2 : Int)(implicit evidence$4 : ClassManifest[T]) : Array[Array[T]]

def ofDim[T](n1 : Int, n2 : Int, n3 : Int)(implicit evidence$5 : ClassManifest[T]) : Array[Array[Array[T]]]

def ofDim[T](n1 : Int, n2 : Int, n3 : Int, n4 : Int)(implicit evidence$6 : ClassManifest[T]) : Array[Array[Array[Array[T]]]]

def ofDim[T](n1 : Int, n2 : Int, n3 : Int, n4 : Int, n5 : Int)(implicit evidence$7 : ClassManifest[T]) : Array[Array[Array[Array[Array[T]]]]]

def concat[T](xss : Array[T]*)(implicit evidence$8 : ClassManifest[T]) : Array[T]
Concatenate all argument sequences into a single array.
Parameters
xs - the given argument sequences
Returns
the array created from the concatenated arguments

def fill[T](n : Int)(elem : => T)(implicit evidence$9 : ClassManifest[T]) : Array[T]
An array that contains the results of some element computation a number of times.
Parameters
n - the number of elements returned
elem - the element computation

def fill[T](n1 : Int, n2 : Int)(elem : => T)(implicit evidence$10 : ClassManifest[T]) : Array[Array[T]]
A two-dimensional array that contains the results of some element computation a number of times.
Parameters
n1 - the number of elements in the 1st dimension
n2 - the number of elements in the 2nd dimension
elem - the element computation

def fill[T](n1 : Int, n2 : Int, n3 : Int)(elem : => T)(implicit evidence$11 : ClassManifest[T]) : Array[Array[Array[T]]]
A three-dimensional array that contains the results of some element computation a number of times.
Parameters
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
elem - the element computation

def fill[T](n1 : Int, n2 : Int, n3 : Int, n4 : Int)(elem : => T)(implicit evidence$12 : ClassManifest[T]) : Array[Array[Array[Array[T]]]]
A four-dimensional array that contains the results of some element computation a number of times.
Parameters
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
elem - the element computation

def fill[T](n1 : Int, n2 : Int, n3 : Int, n4 : Int, n5 : Int)(elem : => T)(implicit evidence$13 : ClassManifest[T]) : Array[Array[Array[Array[Array[T]]]]]
A five-dimensional array that contains the results of some element computation a number of times.
Parameters
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
elem - the element computation

def tabulate[T](n : Int)(f : (Int) => T)(implicit evidence$14 : ClassManifest[T]) : Array[T]
An array containing values of a given function over a range of integer values starting from 0.
Parameters
n - The number of elements in the traversable
f - The function computing element values
Returns
A traversable consisting of elements `f(0), ..., f(n -1)`

def tabulate[T](n1 : Int, n2 : Int)(f : (Int, Int) => T)(implicit evidence$15 : ClassManifest[T]) : Array[Array[T]]
A two-dimensional array containing values of a given function over ranges of integer values starting from 0.
Parameters
n1 - the number of elements in the 1st dimension
n2 - the number of elements in the 2nd dimension
f - The function computing element values

def tabulate[T](n1 : Int, n2 : Int, n3 : Int)(f : (Int, Int, Int) => T)(implicit evidence$16 : ClassManifest[T]) : Array[Array[Array[T]]]
A three-dimensional array containing values of a given function over ranges of integer values starting from 0.
Parameters
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
f - The function computing element values

def tabulate[T](n1 : Int, n2 : Int, n3 : Int, n4 : Int)(f : (Int, Int, Int, Int) => T)(implicit evidence$17 : ClassManifest[T]) : Array[Array[Array[Array[T]]]]
A four-dimensional array containing values of a given function over ranges of integer values starting from 0.
Parameters
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
f - The function computing element values

def tabulate[T](n1 : Int, n2 : Int, n3 : Int, n4 : Int, n5 : Int)(f : (Int, Int, Int, Int, Int) => T)(implicit evidence$18 : ClassManifest[T]) : Array[Array[Array[Array[Array[T]]]]]
A five-dimensional array containing values of a given function over ranges of integer values starting from 0.
Parameters
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
f - The function computing element values

def range(start : Int, end : Int) : Array[Int]
An array containing a sequence of increasing integers in a range.
Parameters
from - the start value of the array
end - the end value of the array (the first value NOT returned)
Returns
the array with values in range `start, start + 1, ..., end - 1` up to, but exclusding, `end`.

def range(start : Int, end : Int, step : Int) : Array[Int]
An array containing equally spaced values in some integer interval.
Parameters
start - the start value of the array
end - the end value of the array (the first value NOT returned)
step - the increment value of the array (must be positive or negative)
Returns
the array with values in `start, start + step, ...` up to, but excluding `end`

def iterate[T](start : T, len : Int)(f : (T) => T)(implicit evidence$19 : ClassManifest[T]) : Array[T]
An array containing repeated applications of a function to a start value.
Parameters
start - the start value of the array
len - the number of elements returned by the array
f - the function that's repeatedly applied
Returns
the array returning `len` values in the sequence `start, f(start), f(f(start)), ...`

def unapplySeq[T](x : Array[T]) : Option[IndexedSeq[T]]
This method is called in a pattern match { case Seq(...) => }.
Parameters
x - the selector value
Returns
sequence wrapped in an option, if this is a Seq, otherwise none

@deprecated("use `Array.fill' instead")

def make[T](n : Int, elem : T)(implicit evidence$20 : ClassManifest[T]) : Array[T]
Create an array containing several copies of an element.
Parameters
n - the length of the resulting array
elem - the element composing the resulting array
Returns
an array composed of n elements all equal to elem

@deprecated("use `Array.tabulate' instead")

def fromFunction[T](f : (Int) => T)(n : Int)(implicit evidence$21 : ClassManifest[T]) : Array[T]
Create an array containing the values of a given function f over given range [0..n)

@deprecated("use `Array.tabulate' instead")

def fromFunction[T](f : (Int, Int) => T)(n1 : Int, n2 : Int)(implicit evidence$22 : ClassManifest[T]) : Array[Array[T]]
Create an array containing the values of a given function f over given range [0..n1, 0..n2)

@deprecated("use `Array.tabulate' instead")

def fromFunction[T](f : (Int, Int, Int) => T)(n1 : Int, n2 : Int, n3 : Int)(implicit evidence$23 : ClassManifest[T]) : Array[Array[Array[T]]]
Create an array containing the values of a given function f over given range [0..n1, 0..n2, 0..n3)

@deprecated("use `Array.tabulate' instead")

def fromFunction[T](f : (Int, Int, Int, Int) => T)(n1 : Int, n2 : Int, n3 : Int, n4 : Int)(implicit evidence$24 : ClassManifest[T]) : Array[Array[Array[Array[T]]]]
Create an array containing the values of a given function f over given range [0..n1, 0..n2, 0..n3, 0..n4)

@deprecated("use `Array.tabulate' instead")

def fromFunction[T](f : (Int, Int, Int, Int, Int) => T)(n1 : Int, n2 : Int, n3 : Int, n4 : Int, n5 : Int)(implicit evidence$25 : ClassManifest[T]) : Array[Array[Array[Array[Array[T]]]]]
Create an array containing the values of a given function f over given range [0..n1, 0..n2, 0..n3, 0..n4, 0..n5)