in scala
class Array

final class Array [A]
extends java.lang.Object
with scala.Seq[A]
with scala.ScalaObject
This class represents polymorphic arrays. It is never instantiated.
Author:
Martin Odersky
Version:
1.0

Constructor Summary
def this (_length: scala.Int)

Def Summary
def apply (i: scala.Int) : A
The element at given index.

Indices start a 0; xs.apply(0) is the first element of array xs.

Note the indexing syntax xs(i) is a shorthand for xs.apply(i).


def deepMkString (sep: java.lang.String) : java.lang.String
Returns a string representation of this array object. The string representations of elements (w.r.t. the method deepToString()) are separated by the string sep.
def deepMkString (start: java.lang.String, sep: java.lang.String, end: java.lang.String) : java.lang.String
Returns a string representation of this array object. The resulting string begins with the string start and is finished by the string end. Inside, the string representations of elements (w.r.t. the method deepToString()) are separated by the string sep.

Ex:
Array(Array(1, 2), Array(3)).deepMkString("[", "; ", "]") = "[[1; 2]; 3]"

def deepToString : java.lang.String

def elements : scala.Iterator[A]
An iterator returning the elements of this array, starting from 0.
override def filter (p: (A) => scala.Boolean) : scala.Array[A]
Returns an array consisting of all elements of this array that satisfy the predicate p. The order of the elements is preserved.
override def flatMap [B] (f: (A) => scala.Iterable[B]) : scala.Array[B]
Applies the given function f to each element of this array, then concatenates the results.
def length : scala.Int
The length of the array
override def map [B] (f: (A) => B) : scala.Array[B]
Returns the array resulting from applying the given function f to each element of this array.
override def slice (from: scala.Int, end: scala.Int) : scala.Array[A]
A sub-array of len elements starting at index from
def subArray (from: scala.Int, end: scala.Int) : scala.Array[A]

def update (i: scala.Int, x: A) : scala.Unit
Update the element at given index. Indices start a 0; xs.apply(0) is the first element of array xs. Note the indexing syntax xs(i) = x is a shorthand for xs.update(i, x).
def zip [B] (that: scala.Array[B]) : scala.Array[scala.Tuple2[A, B]]
Returns an array formed from this array and the specified array that by associating each element of the former with the element at the same position in the latter. If one of the two arrays is longer than the other, its remaining elements are ignored.
def zipWithIndex : scala.Array[scala.Tuple2[A, scala.Int]]
Returns an array that pairs each element of this array with its index, counting from 0.
Def inherited from scala.Seq[A]
++ , concat, contains, copyToArray, drop, dropWhile, filter, flatMap, isDefinedAt, isEmpty, lastIndexOf, length, map, reverse, slice, stringPrefix, subseq, super$drop, super$dropWhile, super$filter, super$take, super$takeWhile, take, takeWhile, toArray, toString
Constructor Detail
def this (_length: scala.Int)

Def Detail
def apply (i: scala.Int): A
The element at given index.

Indices start a 0; xs.apply(0) is the first element of array xs.

Note the indexing syntax xs(i) is a shorthand for xs.apply(i).

Parameters:
i - the index
Throws:
ArrayIndexOutOfBoundsException - if i < 0 or length <= i

def deepMkString (sep: java.lang.String): java.lang.String
Returns a string representation of this array object. The string representations of elements (w.r.t. the method deepToString()) are separated by the string sep.
Parameters:
sep - separator string.
Returns:
a string representation of this array object.

def deepMkString (start: java.lang.String, sep: java.lang.String, end: java.lang.String): java.lang.String
Returns a string representation of this array object. The resulting string begins with the string start and is finished by the string end. Inside, the string representations of elements (w.r.t. the method deepToString()) are separated by the string sep.

Ex:
Array(Array(1, 2), Array(3)).deepMkString("[", "; ", "]") = "[[1; 2]; 3]"

Parameters:
start - starting string.
Parameters:
sep - separator string.
Parameters:
end - ending string.
Returns:
a string representation of this array object.

def deepToString : java.lang.String
Returns:
a deep string representation of this sequence.

def elements : scala.Iterator[A]
An iterator returning the elements of this array, starting from 0.

override def filter (p: (A) => scala.Boolean): scala.Array[A]
Returns an array consisting of all elements of this array that satisfy the predicate p. The order of the elements is preserved.
Parameters:
p - the predicate used to filter the array.
Returns:
the elements of this array satisfying p.

override def flatMap [B](f: (A) => scala.Iterable[B]): scala.Array[B]
Applies the given function f to each element of this array, then concatenates the results.
Parameters:
f - the function to apply on each element.
Returns:
f(a0) ::: ... ::: f(an) if this array is [a0, ..., an].

def length : scala.Int
The length of the array

override def map [B](f: (A) => B): scala.Array[B]
Returns the array resulting from applying the given function f to each element of this array.
Parameters:
f - function to apply to each element.
Returns:
[f(a0), ..., f(an)] if this array is [a0, ..., an].

override def slice (from: scala.Int, end: scala.Int): scala.Array[A]
A sub-array of len elements starting at index from
Parameters:
from - The index of the first element of the slice
Parameters:
end - The index of the element following the slice
Throws:
IndexOutOfBoundsException - if from < 0 or length < from + len

def subArray (from: scala.Int, end: scala.Int): scala.Array[A]
Deprecated:
use slice instead

def update (i: scala.Int, x: A): scala.Unit
Update the element at given index. Indices start a 0; xs.apply(0) is the first element of array xs. Note the indexing syntax xs(i) = x is a shorthand for xs.update(i, x).
Parameters:
i - the index
Parameters:
x - the value to be written at index i
Throws:
ArrayIndexOutOfBoundsException - if i < 0 or length <= i

def zip [B](that: scala.Array[B]): scala.Array[scala.Tuple2[A, B]]
Returns an array formed from this array and the specified array that by associating each element of the former with the element at the same position in the latter. If one of the two arrays is longer than the other, its remaining elements are ignored.
Returns:
Array({a0,b0}, ..., {amin(m,n),bmin(m,n)}) when Array(a0, ..., am) zip Array(b0, ..., bn) is invoked.

def zipWithIndex : scala.Array[scala.Tuple2[A, scala.Int]]
Returns an array that pairs each element of this array with its index, counting from 0.
Returns:
the array Array({a0,0}, {a1,1},...) where ai are the elements of this stream.