scala

Array

object Array extends FallbackArrayBuilding

This object contains utility methods operating on arrays.

Inherits

  1. FallbackArrayBuilding
  2. AnyRef
  3. Any

Value Members

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

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

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

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

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

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

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

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

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

  10. def apply[T](xs: T*)(arg0: ClassManifest[T]): Array[T]

    Create an array with given elements

    Create an array with given elements.

    xs

    the elements to put in the array

    returns

    the array containing elements xs.

  11. def canBuildFrom[T](m: ClassManifest[T]): CanBuildFrom[Array[_], T, Array[T]]

  12. def concat[T](xss: Array[T]*)(arg0: ClassManifest[T]): Array[T]

    Concatenate all argument sequences into a single array

    Concatenate all argument sequences into a single array.

  13. def copy(src: AnyRef, srcPos: Int, dest: AnyRef, destPos: Int, length: Int): Unit

    Copy one array to another

    Copy one array to another. Equivalent to System.arraycopy(src, srcPos, dest, destPos, length), except that this works also for polymorphic and boxed arrays.

    src

    ...

    srcPos

    ...

    dest

    ...

    destPos

    ...

    length

    ...

  14. def empty[T](arg0: ClassManifest[T]): Array[T]

    Returns array of length 0

    Returns array of length 0

  15. def equals(arg0: Any): Boolean

    This method is used to compare the receiver object (this) with the argument object (arg0) for equivalence

    This method is used to compare the receiver object (this) with the argument object (arg0) for equivalence.

    The default implementations of this method is an equivalence relation:

    • It is reflexive: for any instance x of type Any, x.equals(x) should return true.
    • It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true.
    • It is transitive: for any instances x, y, and z of type AnyRef if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

    If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is often necessary to override hashCode to ensure that objects that are "equal" (o1.equals(o2) returns true) hash to the same Int (o1.hashCode.equals(o2.hashCode)).

    arg0

    the object to compare against this object for equality.

    returns

    true if the receiver object is equivalent to the argument; false otherwise.

    definition classes: AnyRef ⇐ Any
  16. def fallbackCanBuildFrom[T](m: DummyImplicit): CanBuildFrom[Array[_], T, GenericArray[T]]

    A builder factory that generates a generic array

    A builder factory that generates a generic array. Called instead of Array.newBuilder if the element type of an array does not have a class manifest. Note that fallbackBuilder fcatory needs an implicit parameter (otherwise it would not be dominated in implicit search by Array.canBuildFrom). We make sure that that implicit search is always succesfull.

    attributes: implicit
    definition classes: FallbackArrayBuilding
  17. def fill[T](n1: Int, n2: Int, n3: Int, n4: Int, n5: Int)(elem: ⇒ T)(arg0: ClassManifest[T]): Array[Array[Array[Array[Array[T]]]]]

    A five-dimensional array that contains the results of some element computation a number of times

    A five-dimensional array that contains the results of some element computation a number of times.

    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

  18. def fill[T](n1: Int, n2: Int, n3: Int, n4: Int)(elem: ⇒ T)(arg0: ClassManifest[T]): Array[Array[Array[Array[T]]]]

    A four-dimensional array that contains the results of some element computation a number of times

    A four-dimensional array that contains the results of some element computation a number of times.

    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

  19. def fill[T](n1: Int, n2: Int, n3: Int)(elem: ⇒ T)(arg0: ClassManifest[T]): Array[Array[Array[T]]]

    A three-dimensional array that contains the results of some element computation a number of times

    A three-dimensional array that contains the results of some element computation a number of times.

    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

  20. def fill[T](n1: Int, n2: Int)(elem: ⇒ T)(arg0: ClassManifest[T]): Array[Array[T]]

    A two-dimensional array that contains the results of some element computation a number of times

    A two-dimensional array that contains the results of some element computation a number of times.

    n1

    the number of elements in the 1st dimension

    n2

    the number of elements in the 2nd dimension

    elem

    the element computation

  21. def fill[T](n: Int)(elem: ⇒ T)(arg0: ClassManifest[T]): Array[T]

    An array that contains the results of some element computation a number of times

    An array that contains the results of some element computation a number of times.

    n

    the number of elements returned

    elem

    the element computation

  22. def fromFunction[T](f: (Int, Int, Int, Int, Int) ⇒ T)(n1: Int, n2: Int, n3: Int, n4: Int, n5: Int)(arg0: ClassManifest[T]): Array[Array[Array[Array[Array[T]]]]]

    Create an array containing the values of a given function f over given range [0

    Create an array containing the values of a given function f over given range [0..n1, 0..n2, 0..n3, 0..n4, 0..n5)

  23. def fromFunction[T](f: (Int, Int, Int, Int) ⇒ T)(n1: Int, n2: Int, n3: Int, n4: Int)(arg0: ClassManifest[T]): Array[Array[Array[Array[T]]]]

    Create an array containing the values of a given function f over given range [0

    Create an array containing the values of a given function f over given range [0..n1, 0..n2, 0..n3, 0..n4)

  24. def fromFunction[T](f: (Int, Int, Int) ⇒ T)(n1: Int, n2: Int, n3: Int)(arg0: ClassManifest[T]): Array[Array[Array[T]]]

    Create an array containing the values of a given function f over given range [0

    Create an array containing the values of a given function f over given range [0..n1, 0..n2, 0..n3)

  25. def fromFunction[T](f: (Int, Int) ⇒ T)(n1: Int, n2: Int)(arg0: ClassManifest[T]): Array[Array[T]]

    Create an array containing the values of a given function f over given range [0

    Create an array containing the values of a given function f over given range [0..n1, 0..n2)

  26. def fromFunction[T](f: (Int) ⇒ T)(n: Int)(arg0: ClassManifest[T]): Array[T]

    Create an array containing the values of a given function f over given range [0

    Create an array containing the values of a given function f over given range [0..n)

  27. def hashCode(): Int

    Returns a hash code value for the object

    Returns a hash code value for the object.

    The default hashing algorithm is platform dependent.

    Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet not be equal (o1.equals(o2) returns false). A degenerate implementation could always return 0. However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals method.

    definition classes: AnyRef ⇐ Any
  28. def iterate[T](start: T, len: Int)(f: (T) ⇒ T)(arg0: ClassManifest[T]): Array[T]

    An array containing repeated applications of a function to a start value

    An array containing repeated applications of a function to a start value.

    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)), ...

  29. def make[T](n: Int, elem: T)(arg0: ClassManifest[T]): Array[T]

    Create an array containing several copies of an element

    Create an array containing several copies of an element.

    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

  30. def newBuilder[T](m: ClassManifest[T]): ArrayBuilder[T]

  31. def ofDim[T](n1: Int, n2: Int, n3: Int, n4: Int, n5: Int)(arg0: ClassManifest[T]): Array[Array[Array[Array[Array[T]]]]]

  32. def ofDim[T](n1: Int, n2: Int, n3: Int, n4: Int)(arg0: ClassManifest[T]): Array[Array[Array[Array[T]]]]

  33. def ofDim[T](n1: Int, n2: Int, n3: Int)(arg0: ClassManifest[T]): Array[Array[Array[T]]]

  34. def ofDim[T](n1: Int, n2: Int)(arg0: ClassManifest[T]): Array[Array[T]]

  35. def ofDim[T](n1: Int)(arg0: ClassManifest[T]): Array[T]

    Create array with given dimensions

    Create array with given dimensions

  36. def range(start: Int, end: Int, step: Int): Array[Int]

    An array containing equally spaced values in some integer interval

    An array containing equally spaced values in some integer interval.

    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

  37. def range(start: Int, end: Int): Array[Int]

    An array containing a sequence of increasing integers in a range

    An array containing a sequence of increasing integers in a range.

    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.

  38. def tabulate[T](n1: Int, n2: Int, n3: Int, n4: Int, n5: Int)(f: (Int, Int, Int, Int, Int) ⇒ T)(arg0: 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

    A five-dimensional array containing values of a given function over ranges of integer values starting from 0.

    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

  39. def tabulate[T](n1: Int, n2: Int, n3: Int, n4: Int)(f: (Int, Int, Int, Int) ⇒ T)(arg0: 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

    A four-dimensional array containing values of a given function over ranges of integer values starting from 0.

    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

  40. def tabulate[T](n1: Int, n2: Int, n3: Int)(f: (Int, Int, Int) ⇒ T)(arg0: ClassManifest[T]): Array[Array[Array[T]]]

    A three-dimensional array containing values of a given function over ranges of integer values starting from 0

    A three-dimensional array containing values of a given function over ranges of integer values starting from 0.

    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

  41. def tabulate[T](n1: Int, n2: Int)(f: (Int, Int) ⇒ T)(arg0: ClassManifest[T]): Array[Array[T]]

    A two-dimensional array containing values of a given function over ranges of integer values starting from 0

    A two-dimensional array containing values of a given function over ranges of integer values starting from 0.

    n1

    the number of elements in the 1st dimension

    n2

    the number of elements in the 2nd dimension

    f

    The function computing element values

  42. def tabulate[T](n: Int)(f: (Int) ⇒ T)(arg0: ClassManifest[T]): Array[T]

    An array containing values of a given function over a range of integer values starting from 0

    An array containing values of a given function over a range of integer values starting from 0.

    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)

  43. def toString(): String

    Returns a string representation of the object

    Returns a string representation of the object.

    The default representation is platform dependent.

    definition classes: AnyRef ⇐ Any
  44. def unapplySeq[T](x: Array[T]): Option[IndexedSeq[T]]

    This method is called in a pattern match { case Seq(

    This method is called in a pattern match { case Seq(...) => }.

    x

    the selector value

    returns

    sequence wrapped in an option, if this is a Seq, otherwise none