scala

object Array

[source: scala/Array.scala]

object Array
extends AnyRef
This object contains utility methods operating on arrays.
Author
Martin Odersky
Version
1.0
Method Summary
def apply (xs : Double*) : Array[Double]
def apply (xs : Short*) : Array[Short]
def apply (xs : Byte*) : Array[Byte]
def apply [A <: AnyRef](xs : A*) : Array[A]
Create an array with given elements.
def apply (xs : Unit*) : Array[Unit]
def apply (xs : Boolean*) : Array[Boolean]
def apply (xs : Long*) : Array[Long]
def apply (xs : Float*) : Array[Float]
def apply (xs : Char*) : Array[Char]
def apply (xs : Int*) : Array[Int]
def concat [T](xs : Seq[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 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 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) => 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) => A)(n : Int) : Array[A]
Create an array containing the values of a given function f over given range [0..n)
def make [A](n : Int, elem : A) : Array[A]
Create an array containing several copies of an element.
def range (start : Int, end : Int) : Array[Int]
Create a an array containing of successive integers.
def unapplySeq [A](x : Array[A]) : Option[Seq[A]]
This method is called as a result of a pattern match { case Array(...) => } or val Array(...) = ....
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Class Summary
trait Array0 [A] extends ArrayLike[A]
trait ArrayLike [A] extends Mutable[A]
trait Projection [A] extends MutableProjection[A] with ArrayLike[A]
Method Details
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 : Seq[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 range(start : Int, end : Int) : Array[Int]
Create a an array containing of successive integers.
Parameters
from - the value of the first element of the array
end - the value of the last element fo the array plus 1
Returns
the sorted array of all integers in range [from;end).

def apply[A <: AnyRef](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 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

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) => 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) => 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, 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 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 unapplySeq[A](x : Array[A]) : Option[Seq[A]]
This method is called as a result of a pattern match { case Array(...) => } or val Array(...) = ....
Parameters
x - the selector value
Returns
array wrapped in an option