scala

object Array

[source: scala/Array.scala]

object Array
extends SequenceFactory[Array]
This object contains utility methods operating on arrays.
Author
Martin Odersky
Version
1.0
Method Summary
def apply (xs : Char*) : Array[Char]
def apply (xs : Float*) : Array[Float]
def apply (xs : Int*) : Array[Int]
def apply (xs : Long*) : Array[Long]
def apply (xs : Byte*) : Array[Byte]
def apply (xs : Unit*) : Array[Unit]
def apply (xs : Double*) : Array[Double]
def apply (xs : Boolean*) : Array[Boolean]
def apply (xs : Short*) : Array[Short]
override def apply [A](xs : A*) : Array[A]
Create an array with given elements.
implicit def builderFactory [A] : BuilderFactory[A, Array[A], Array]
def concat [T](xs : Sequence[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.
override def empty [A] : Array[A]
Returns array of length 0
def fromFunction [A](f : (Int) => A)(n : Int) : Array[A]
Create an array containing the values of a given function f over given range [0..n)
def fromFunction [A](f : (Int, Int, Int) => A)(n1 : Int, n2 : Int, n3 : Int) : Array[Array[Array[A]]]
Create an array containing the values of a given function f over given range [0..n1, 0..n2, 0..n3)
def fromFunction [A](f : (Int, Int) => A)(n1 : Int, n2 : Int) : Array[Array[A]]
Create an array containing the values of a given function f over given range [0..n1, 0..n2)
def fromFunction [A](f : (Int, Int, Int, Int, Int) => A)(n1 : Int, n2 : Int, n3 : Int, n4 : Int, n5 : Int) : Array[Array[Array[Array[Array[A]]]]]
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 [A](f : (Int, Int, Int, Int) => A)(n1 : Int, n2 : Int, n3 : Int, n4 : Int) : Array[Array[Array[Array[A]]]]
Create an array containing the values of a given function f over given range [0..n1, 0..n2, 0..n3, 0..n4)
def make [A](n : Int, elem : A) : Array[A]
Create an array containing several copies of an element.
def newBuilder [A] : Builder[A, Array[A]]
def ofDim [A](n1 : Int, n2 : Int, n3 : Int) : Array[Array[Array[A]]]
def ofDim [A](n1 : Int, n2 : Int, n3 : Int, n4 : Int) : Array[Array[Array[Array[A]]]]
def ofDim [A](n1 : Int) : Array[A]
Create array with given dimensions
def ofDim [A](n1 : Int, n2 : Int, n3 : Int, n4 : Int, n5 : Int) : Array[Array[Array[Array[Array[A]]]]]
def ofDim [A](n1 : Int, n2 : Int) : Array[Array[A]]
Methods inherited from SequenceFactory
unapplySeq
Methods inherited from TraversableFactory
concat, fill, fill, fill, fill, fill, tabulate, tabulate, tabulate, tabulate, tabulate, range, range, iterate
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 builderFactory[A] : BuilderFactory[A, Array[A], Array]

def newBuilder[A] : Builder[A, Array[A]]

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 concat[T](xs : Sequence[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

override def empty[A] : Array[A]
Returns array of length 0

override def apply[A](xs : A*) : Array[A]
Create an array with given elements.
Parameters
xs - the elements to put in the array
Returns
the array containing elements xs.

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

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

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

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

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

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

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

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

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

def ofDim[A](n1 : Int) : Array[A]
Create array with given dimensions

def ofDim[A](n1 : Int, n2 : Int) : Array[Array[A]]

def ofDim[A](n1 : Int, n2 : Int, n3 : Int) : Array[Array[Array[A]]]

def ofDim[A](n1 : Int, n2 : Int, n3 : Int, n4 : Int) : Array[Array[Array[Array[A]]]]

def ofDim[A](n1 : Int, n2 : Int, n3 : Int, n4 : Int, n5 : Int) : Array[Array[Array[Array[Array[A]]]]]

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

def make[A](n : Int, elem : A) : Array[A]
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[A](f : (Int) => A)(n : Int) : Array[A]
Create an array containing the values of a given function f over given range [0..n)

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

def fromFunction[A](f : (Int, Int) => A)(n1 : Int, n2 : Int) : Array[Array[A]]
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[A](f : (Int, Int, Int) => A)(n1 : Int, n2 : Int, n3 : Int) : Array[Array[Array[A]]]
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[A](f : (Int, Int, Int, Int) => A)(n1 : Int, n2 : Int, n3 : Int, n4 : Int) : Array[Array[Array[Array[A]]]]
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[A](f : (Int, Int, Int, Int, Int) => A)(n1 : Int, n2 : Int, n3 : Int, n4 : Int, n5 : Int) : Array[Array[Array[Array[Array[A]]]]]
Create an array containing the values of a given function f over given range [0..n1, 0..n2, 0..n3, 0..n4, 0..n5)