Test two objects for inequality.
Test two objects for inequality.
true
if !(this == that), false otherwise.
Equivalent to x.hashCode
except for boxed numeric types and null
.
Equivalent to x.hashCode
except for boxed numeric types and null
.
For numerics, it returns a hash value which is consistent
with value equality: if two value type instances compare
as true, then ## will produce the same hash value for each
of them.
For null
returns a hashcode where null.hashCode
throws a
NullPointerException
.
a hash value consistent with ==
[use case] Returns a new array containing the elements from the left hand operand followed by the elements from the right hand operand.
Returns a new array containing the elements from the left hand operand followed by the elements from the right hand operand. The element type of the array is the most specific superclass encompassing the element types of the two operands.
Example:
scala> val a = List(1) a: List[Int] = List(1) scala> val b = List(2) b: List[Int] = List(2) scala> val c = a ++ b c: List[Int] = List(1, 2) scala> val d = List('a') d: List[Char] = List(a) scala> val e = c ++ d e: List[AnyVal] = List(1, 2, a)
the element type of the returned collection.
the traversable to append.
a new array which contains all elements of this array
followed by all elements of that
.
[use case] Returns a new array containing the elements from the left hand operand followed by the elements from the right hand operand.
Returns a new array containing the elements from the left hand operand followed by the elements from the right hand operand. The element type of the array is the most specific superclass encompassing the element types of the two operands.
Example:
scala> val a = List(1) a: List[Int] = List(1) scala> val b = List(2) b: List[Int] = List(2) scala> val c = a ++ b c: List[Int] = List(1, 2) scala> val d = List('a') d: List[Char] = List(a) scala> val e = c ++ d e: List[AnyVal] = List(1, 2, a)
the element type of the returned collection.
the traversable to append.
a new array which contains all elements of this array
followed by all elements of that
.
[use case] Returns a new array containing the elements from the left hand operand followed by the elements from the right hand operand.
Returns a new array containing the elements from the left hand operand followed by the elements from the right hand operand. The element type of the array is the most specific superclass encompassing the element types of the two operands.
Example:
scala> val a = List(1) a: List[Int] = List(1) scala> val b = List(2) b: List[Int] = List(2) scala> val c = a ++ b c: List[Int] = List(1, 2) scala> val d = List('a') d: List[Char] = List(a) scala> val e = c ++ d e: List[AnyVal] = List(1, 2, a)
the element type of the returned collection.
the traversable to append.
a new array which contains all elements of this array
followed by all elements of that
.
[use case] Returns a new array containing the elements from the left hand operand followed by the elements from the right hand operand.
Returns a new array containing the elements from the left hand operand followed by the elements from the right hand operand. The element type of the array is the most specific superclass encompassing the element types of the two operands.
Example:
scala> val a = List(1) a: List[Int] = List(1) scala> val b = List(2) b: List[Int] = List(2) scala> val c = a ++ b c: List[Int] = List(1, 2) scala> val d = List('a') d: List[Char] = List(a) scala> val e = c ++ d e: List[AnyVal] = List(1, 2, a)
the element type of the returned collection.
the traversable to append.
a new array which contains all elements of this array
followed by all elements of that
.
[use case] Returns a new array containing the elements from the left hand operand followed by the elements from the right hand operand.
Returns a new array containing the elements from the left hand operand followed by the elements from the right hand operand. The element type of the array is the most specific superclass encompassing the element types of the two operands.
Example:
scala> val a = List(1) a: List[Int] = List(1) scala> val b = List(2) b: List[Int] = List(2) scala> val c = a ++ b c: List[Int] = List(1, 2) scala> val d = List('a') d: List[Char] = List(a) scala> val e = c ++ d e: List[AnyVal] = List(1, 2, a)
the element type of the returned collection.
the traversable to append.
a new array which contains all elements of this array
followed by all elements of that
.
[use case] Returns a new array containing the elements from the left hand operand followed by the elements from the right hand operand.
Returns a new array containing the elements from the left hand operand followed by the elements from the right hand operand. The element type of the array is the most specific superclass encompassing the element types of the two operands.
Example:
scala> val a = List(1) a: List[Int] = List(1) scala> val b = List(2) b: List[Int] = List(2) scala> val c = a ++ b c: List[Int] = List(1, 2) scala> val d = List('a') d: List[Char] = List(a) scala> val e = c ++ d e: List[AnyVal] = List(1, 2, a)
the element type of the returned collection.
the traversable to append.
a new array which contains all elements of this array
followed by all elements of that
.
[use case] Returns a new array containing the elements from the left hand operand followed by the elements from the right hand operand.
Returns a new array containing the elements from the left hand operand followed by the elements from the right hand operand. The element type of the array is the most specific superclass encompassing the element types of the two operands.
Example:
scala> val a = List(1) a: List[Int] = List(1) scala> val b = List(2) b: List[Int] = List(2) scala> val c = a ++ b c: List[Int] = List(1, 2) scala> val d = List('a') d: List[Char] = List(a) scala> val e = c ++ d e: List[AnyVal] = List(1, 2, a)
the element type of the returned collection.
the traversable to append.
a new array which contains all elements of this array
followed by all elements of that
.
[use case] Returns a new array containing the elements from the left hand operand followed by the elements from the right hand operand.
Returns a new array containing the elements from the left hand operand followed by the elements from the right hand operand. The element type of the array is the most specific superclass encompassing the element types of the two operands.
Example:
scala> val a = List(1) a: List[Int] = List(1) scala> val b = List(2) b: List[Int] = List(2) scala> val c = a ++ b c: List[Int] = List(1, 2) scala> val d = List('a') d: List[Char] = List(a) scala> val e = c ++ d e: List[AnyVal] = List(1, 2, a)
the element type of the returned collection.
the traversable to append.
a new array which contains all elements of this array
followed by all elements of that
.
[use case] Returns a new array containing the elements from the left hand operand followed by the elements from the right hand operand.
Returns a new array containing the elements from the left hand operand followed by the elements from the right hand operand. The element type of the array is the most specific superclass encompassing the element types of the two operands.
Example:
scala> val a = List(1) a: List[Int] = List(1) scala> val b = List(2) b: List[Int] = List(2) scala> val c = a ++ b c: List[Int] = List(1, 2) scala> val d = List('a') d: List[Char] = List(a) scala> val e = c ++ d e: List[AnyVal] = List(1, 2, a)
the element type of the returned collection.
the traversable to append.
a new array which contains all elements of this array
followed by all elements of that
.
[use case] Returns a new array containing the elements from the left hand operand followed by the elements from the right hand operand.
Returns a new array containing the elements from the left hand operand followed by the elements from the right hand operand. The element type of the array is the most specific superclass encompassing the element types of the two operands.
Example:
scala> val a = List(1) a: List[Int] = List(1) scala> val b = List(2) b: List[Int] = List(2) scala> val c = a ++ b c: List[Int] = List(1, 2) scala> val d = List('a') d: List[Char] = List(a) scala> val e = c ++ d e: List[AnyVal] = List(1, 2, a)
the element type of the returned collection.
the traversable to append.
a new array which contains all elements of this array
followed by all elements of that
.
[use case] Returns a new array containing the elements from the left hand operand followed by the elements from the right hand operand.
Returns a new array containing the elements from the left hand operand followed by the elements from the right hand operand. The element type of the array is the most specific superclass encompassing the element types of the two operands.
Example:
scala> val a = List(1) a: List[Int] = List(1) scala> val b = List(2) b: List[Int] = List(2) scala> val c = a ++ b c: List[Int] = List(1, 2) scala> val d = List('a') d: List[Char] = List(a) scala> val e = c ++ d e: List[AnyVal] = List(1, 2, a)
the element type of the returned collection.
the traversable to append.
a new array which contains all elements of this array
followed by all elements of that
.
As with ++
, returns a new collection containing the elements from the
left operand followed by the elements from the right operand.
As with ++
, returns a new collection containing the elements from the
left operand followed by the elements from the right operand.
It differs from ++
in that the right operand determines the type of
the resulting collection rather than the left one.
Mnemonic: the COLon is on the side of the new COLlection type.
Example:
scala> val x = List(1) x: List[Int] = List(1) scala> val y = LinkedList(2) y: scala.collection.mutable.LinkedList[Int] = LinkedList(2) scala> val z = x ++: y z: scala.collection.mutable.LinkedList[Int] = LinkedList(1, 2)
This overload exists because: for the implementation of ++:
we should
reuse that of ++
because many collections override it with more
efficient versions.
Since TraversableOnce
has no ++
method, we have to implement that
directly, but Traversable
and down can use the overload.
the element type of the returned collection.
the class of the returned collection. Where possible, That
is
the same class as the current collection class Repr
, but this
depends on the element type B
being admissible for that class,
which means that an implicit instance of type CanBuildFrom[Repr, B, That]
is found.
the traversable to append.
an implicit value of class CanBuildFrom
which determines the
result class That
from the current representation type Repr
and the new element type B
.
a new collection of type That
which contains all elements
of this mutable indexed sequence followed by all elements of that
.
[use case] As with ++
, returns a new collection containing the elements from the left operand followed by the
elements from the right operand.
As with ++
, returns a new collection containing the elements from the left operand followed by the
elements from the right operand.
It differs from ++
in that the right operand determines the type of
the resulting collection rather than the left one.
Mnemonic: the COLon is on the side of the new COLlection type.
Example:
scala> val x = List(1) x: List[Int] = List(1) scala> val y = LinkedList(2) y: scala.collection.mutable.LinkedList[Int] = LinkedList(2) scala> val z = x ++: y z: scala.collection.mutable.LinkedList[Int] = LinkedList(1, 2)
the element type of the returned collection.
the traversable to append.
a new array which contains all elements of this array
followed by all elements of that
.
As with ++
, returns a new collection containing the elements from the
left operand followed by the elements from the right operand.
As with ++
, returns a new collection containing the elements from the
left operand followed by the elements from the right operand.
It differs from ++
in that the right operand determines the type of
the resulting collection rather than the left one.
Mnemonic: the COLon is on the side of the new COLlection type.
Example:
scala> val x = List(1) x: List[Int] = List(1) scala> val y = LinkedList(2) y: scala.collection.mutable.LinkedList[Int] = LinkedList(2) scala> val z = x ++: y z: scala.collection.mutable.LinkedList[Int] = LinkedList(1, 2)
This overload exists because: for the implementation of ++:
we should
reuse that of ++
because many collections override it with more
efficient versions.
Since TraversableOnce
has no ++
method, we have to implement that
directly, but Traversable
and down can use the overload.
the element type of the returned collection.
the class of the returned collection. Where possible, That
is
the same class as the current collection class Repr
, but this
depends on the element type B
being admissible for that class,
which means that an implicit instance of type CanBuildFrom[Repr, B, That]
is found.
the traversable to append.
an implicit value of class CanBuildFrom
which determines the
result class That
from the current representation type Repr
and the new element type B
.
a new collection of type That
which contains all elements
of this mutable indexed sequence followed by all elements of that
.
[use case] As with ++
, returns a new collection containing the elements from the left operand followed by the
elements from the right operand.
As with ++
, returns a new collection containing the elements from the left operand followed by the
elements from the right operand.
It differs from ++
in that the right operand determines the type of
the resulting collection rather than the left one.
Mnemonic: the COLon is on the side of the new COLlection type.
Example:
scala> val x = List(1) x: List[Int] = List(1) scala> val y = LinkedList(2) y: scala.collection.mutable.LinkedList[Int] = LinkedList(2) scala> val z = x ++: y z: scala.collection.mutable.LinkedList[Int] = LinkedList(1, 2)
the element type of the returned collection.
the traversable to append.
a new array which contains all elements of this array
followed by all elements of that
.
As with ++
, returns a new collection containing the elements from the
left operand followed by the elements from the right operand.
As with ++
, returns a new collection containing the elements from the
left operand followed by the elements from the right operand.
It differs from ++
in that the right operand determines the type of
the resulting collection rather than the left one.
Mnemonic: the COLon is on the side of the new COLlection type.
Example:
scala> val x = List(1) x: List[Int] = List(1) scala> val y = LinkedList(2) y: scala.collection.mutable.LinkedList[Int] = LinkedList(2) scala> val z = x ++: y z: scala.collection.mutable.LinkedList[Int] = LinkedList(1, 2)
This overload exists because: for the implementation of ++:
we should
reuse that of ++
because many collections override it with more
efficient versions.
Since TraversableOnce
has no ++
method, we have to implement that
directly, but Traversable
and down can use the overload.
the element type of the returned collection.
the class of the returned collection. Where possible, That
is
the same class as the current collection class Repr
, but this
depends on the element type B
being admissible for that class,
which means that an implicit instance of type CanBuildFrom[Repr, B, That]
is found.
the traversable to append.
an implicit value of class CanBuildFrom
which determines the
result class That
from the current representation type Repr
and the new element type B
.
a new collection of type That
which contains all elements
of this mutable indexed sequence followed by all elements of that
.
[use case] As with ++
, returns a new collection containing the elements from the left operand followed by the
elements from the right operand.
As with ++
, returns a new collection containing the elements from the left operand followed by the
elements from the right operand.
It differs from ++
in that the right operand determines the type of
the resulting collection rather than the left one.
Mnemonic: the COLon is on the side of the new COLlection type.
Example:
scala> val x = List(1) x: List[Int] = List(1) scala> val y = LinkedList(2) y: scala.collection.mutable.LinkedList[Int] = LinkedList(2) scala> val z = x ++: y z: scala.collection.mutable.LinkedList[Int] = LinkedList(1, 2)
the element type of the returned collection.
the traversable to append.
a new array which contains all elements of this array
followed by all elements of that
.
As with ++
, returns a new collection containing the elements from the
left operand followed by the elements from the right operand.
As with ++
, returns a new collection containing the elements from the
left operand followed by the elements from the right operand.
It differs from ++
in that the right operand determines the type of
the resulting collection rather than the left one.
Mnemonic: the COLon is on the side of the new COLlection type.
Example:
scala> val x = List(1) x: List[Int] = List(1) scala> val y = LinkedList(2) y: scala.collection.mutable.LinkedList[Int] = LinkedList(2) scala> val z = x ++: y z: scala.collection.mutable.LinkedList[Int] = LinkedList(1, 2)
This overload exists because: for the implementation of ++:
we should
reuse that of ++
because many collections override it with more
efficient versions.
Since TraversableOnce
has no ++
method, we have to implement that
directly, but Traversable
and down can use the overload.
the element type of the returned collection.
the class of the returned collection. Where possible, That
is
the same class as the current collection class Repr
, but this
depends on the element type B
being admissible for that class,
which means that an implicit instance of type CanBuildFrom[Repr, B, That]
is found.
the traversable to append.
an implicit value of class CanBuildFrom
which determines the
result class That
from the current representation type Repr
and the new element type B
.
a new collection of type That
which contains all elements
of this mutable indexed sequence followed by all elements of that
.
[use case] As with ++
, returns a new collection containing the elements from the left operand followed by the
elements from the right operand.
As with ++
, returns a new collection containing the elements from the left operand followed by the
elements from the right operand.
It differs from ++
in that the right operand determines the type of
the resulting collection rather than the left one.
Mnemonic: the COLon is on the side of the new COLlection type.
Example:
scala> val x = List(1) x: List[Int] = List(1) scala> val y = LinkedList(2) y: scala.collection.mutable.LinkedList[Int] = LinkedList(2) scala> val z = x ++: y z: scala.collection.mutable.LinkedList[Int] = LinkedList(1, 2)
the element type of the returned collection.
the traversable to append.
a new array which contains all elements of this array
followed by all elements of that
.
As with ++
, returns a new collection containing the elements from the
left operand followed by the elements from the right operand.
As with ++
, returns a new collection containing the elements from the
left operand followed by the elements from the right operand.
It differs from ++
in that the right operand determines the type of
the resulting collection rather than the left one.
Mnemonic: the COLon is on the side of the new COLlection type.
Example:
scala> val x = List(1) x: List[Int] = List(1) scala> val y = LinkedList(2) y: scala.collection.mutable.LinkedList[Int] = LinkedList(2) scala> val z = x ++: y z: scala.collection.mutable.LinkedList[Int] = LinkedList(1, 2)
This overload exists because: for the implementation of ++:
we should
reuse that of ++
because many collections override it with more
efficient versions.
Since TraversableOnce
has no ++
method, we have to implement that
directly, but Traversable
and down can use the overload.
the element type of the returned collection.
the class of the returned collection. Where possible, That
is
the same class as the current collection class Repr
, but this
depends on the element type B
being admissible for that class,
which means that an implicit instance of type CanBuildFrom[Repr, B, That]
is found.
the traversable to append.
an implicit value of class CanBuildFrom
which determines the
result class That
from the current representation type Repr
and the new element type B
.
a new collection of type That
which contains all elements
of this mutable indexed sequence followed by all elements of that
.
[use case] As with ++
, returns a new collection containing the elements from the left operand followed by the
elements from the right operand.
As with ++
, returns a new collection containing the elements from the left operand followed by the
elements from the right operand.
It differs from ++
in that the right operand determines the type of
the resulting collection rather than the left one.
Mnemonic: the COLon is on the side of the new COLlection type.
Example:
scala> val x = List(1) x: List[Int] = List(1) scala> val y = LinkedList(2) y: scala.collection.mutable.LinkedList[Int] = LinkedList(2) scala> val z = x ++: y z: scala.collection.mutable.LinkedList[Int] = LinkedList(1, 2)
the element type of the returned collection.
the traversable to append.
a new array which contains all elements of this array
followed by all elements of that
.
As with ++
, returns a new collection containing the elements from the
left operand followed by the elements from the right operand.
As with ++
, returns a new collection containing the elements from the
left operand followed by the elements from the right operand.
It differs from ++
in that the right operand determines the type of
the resulting collection rather than the left one.
Mnemonic: the COLon is on the side of the new COLlection type.
Example:
scala> val x = List(1) x: List[Int] = List(1) scala> val y = LinkedList(2) y: scala.collection.mutable.LinkedList[Int] = LinkedList(2) scala> val z = x ++: y z: scala.collection.mutable.LinkedList[Int] = LinkedList(1, 2)
This overload exists because: for the implementation of ++:
we should
reuse that of ++
because many collections override it with more
efficient versions.
Since TraversableOnce
has no ++
method, we have to implement that
directly, but Traversable
and down can use the overload.
the element type of the returned collection.
the class of the returned collection. Where possible, That
is
the same class as the current collection class Repr
, but this
depends on the element type B
being admissible for that class,
which means that an implicit instance of type CanBuildFrom[Repr, B, That]
is found.
the traversable to append.
an implicit value of class CanBuildFrom
which determines the
result class That
from the current representation type Repr
and the new element type B
.
a new collection of type That
which contains all elements
of this mutable indexed sequence followed by all elements of that
.
[use case] As with ++
, returns a new collection containing the elements from the left operand followed by the
elements from the right operand.
As with ++
, returns a new collection containing the elements from the left operand followed by the
elements from the right operand.
It differs from ++
in that the right operand determines the type of
the resulting collection rather than the left one.
Mnemonic: the COLon is on the side of the new COLlection type.
Example:
scala> val x = List(1) x: List[Int] = List(1) scala> val y = LinkedList(2) y: scala.collection.mutable.LinkedList[Int] = LinkedList(2) scala> val z = x ++: y z: scala.collection.mutable.LinkedList[Int] = LinkedList(1, 2)
the element type of the returned collection.
the traversable to append.
a new array which contains all elements of this array
followed by all elements of that
.
As with ++
, returns a new collection containing the elements from the
left operand followed by the elements from the right operand.
As with ++
, returns a new collection containing the elements from the
left operand followed by the elements from the right operand.
It differs from ++
in that the right operand determines the type of
the resulting collection rather than the left one.
Mnemonic: the COLon is on the side of the new COLlection type.
Example:
scala> val x = List(1) x: List[Int] = List(1) scala> val y = LinkedList(2) y: scala.collection.mutable.LinkedList[Int] = LinkedList(2) scala> val z = x ++: y z: scala.collection.mutable.LinkedList[Int] = LinkedList(1, 2)
This overload exists because: for the implementation of ++:
we should
reuse that of ++
because many collections override it with more
efficient versions.
Since TraversableOnce
has no ++
method, we have to implement that
directly, but Traversable
and down can use the overload.
the element type of the returned collection.
the class of the returned collection. Where possible, That
is
the same class as the current collection class Repr
, but this
depends on the element type B
being admissible for that class,
which means that an implicit instance of type CanBuildFrom[Repr, B, That]
is found.
the traversable to append.
an implicit value of class CanBuildFrom
which determines the
result class That
from the current representation type Repr
and the new element type B
.
a new collection of type That
which contains all elements
of this mutable indexed sequence followed by all elements of that
.
[use case] As with ++
, returns a new collection containing the elements from the left operand followed by the
elements from the right operand.
As with ++
, returns a new collection containing the elements from the left operand followed by the
elements from the right operand.
It differs from ++
in that the right operand determines the type of
the resulting collection rather than the left one.
Mnemonic: the COLon is on the side of the new COLlection type.
Example:
scala> val x = List(1) x: List[Int] = List(1) scala> val y = LinkedList(2) y: scala.collection.mutable.LinkedList[Int] = LinkedList(2) scala> val z = x ++: y z: scala.collection.mutable.LinkedList[Int] = LinkedList(1, 2)
the element type of the returned collection.
the traversable to append.
a new array which contains all elements of this array
followed by all elements of that
.
As with ++
, returns a new collection containing the elements from the
left operand followed by the elements from the right operand.
As with ++
, returns a new collection containing the elements from the
left operand followed by the elements from the right operand.
It differs from ++
in that the right operand determines the type of
the resulting collection rather than the left one.
Mnemonic: the COLon is on the side of the new COLlection type.
Example:
scala> val x = List(1) x: List[Int] = List(1) scala> val y = LinkedList(2) y: scala.collection.mutable.LinkedList[Int] = LinkedList(2) scala> val z = x ++: y z: scala.collection.mutable.LinkedList[Int] = LinkedList(1, 2)
This overload exists because: for the implementation of ++:
we should
reuse that of ++
because many collections override it with more
efficient versions.
Since TraversableOnce
has no ++
method, we have to implement that
directly, but Traversable
and down can use the overload.
the element type of the returned collection.
the class of the returned collection. Where possible, That
is
the same class as the current collection class Repr
, but this
depends on the element type B
being admissible for that class,
which means that an implicit instance of type CanBuildFrom[Repr, B, That]
is found.
the traversable to append.
an implicit value of class CanBuildFrom
which determines the
result class That
from the current representation type Repr
and the new element type B
.
a new collection of type That
which contains all elements
of this mutable indexed sequence followed by all elements of that
.
[use case] As with ++
, returns a new collection containing the elements from the left operand followed by the
elements from the right operand.
As with ++
, returns a new collection containing the elements from the left operand followed by the
elements from the right operand.
It differs from ++
in that the right operand determines the type of
the resulting collection rather than the left one.
Mnemonic: the COLon is on the side of the new COLlection type.
Example:
scala> val x = List(1) x: List[Int] = List(1) scala> val y = LinkedList(2) y: scala.collection.mutable.LinkedList[Int] = LinkedList(2) scala> val z = x ++: y z: scala.collection.mutable.LinkedList[Int] = LinkedList(1, 2)
the element type of the returned collection.
the traversable to append.
a new array which contains all elements of this array
followed by all elements of that
.
As with ++
, returns a new collection containing the elements from the
left operand followed by the elements from the right operand.
As with ++
, returns a new collection containing the elements from the
left operand followed by the elements from the right operand.
It differs from ++
in that the right operand determines the type of
the resulting collection rather than the left one.
Mnemonic: the COLon is on the side of the new COLlection type.
Example:
scala> val x = List(1) x: List[Int] = List(1) scala> val y = LinkedList(2) y: scala.collection.mutable.LinkedList[Int] = LinkedList(2) scala> val z = x ++: y z: scala.collection.mutable.LinkedList[Int] = LinkedList(1, 2)
This overload exists because: for the implementation of ++:
we should
reuse that of ++
because many collections override it with more
efficient versions.
Since TraversableOnce
has no ++
method, we have to implement that
directly, but Traversable
and down can use the overload.
the element type of the returned collection.
the class of the returned collection. Where possible, That
is
the same class as the current collection class Repr
, but this
depends on the element type B
being admissible for that class,
which means that an implicit instance of type CanBuildFrom[Repr, B, That]
is found.
the traversable to append.
an implicit value of class CanBuildFrom
which determines the
result class That
from the current representation type Repr
and the new element type B
.
a new collection of type That
which contains all elements
of this mutable indexed sequence followed by all elements of that
.
[use case] As with ++
, returns a new collection containing the elements from the left operand followed by the
elements from the right operand.
As with ++
, returns a new collection containing the elements from the left operand followed by the
elements from the right operand.
It differs from ++
in that the right operand determines the type of
the resulting collection rather than the left one.
Mnemonic: the COLon is on the side of the new COLlection type.
Example:
scala> val x = List(1) x: List[Int] = List(1) scala> val y = LinkedList(2) y: scala.collection.mutable.LinkedList[Int] = LinkedList(2) scala> val z = x ++: y z: scala.collection.mutable.LinkedList[Int] = LinkedList(1, 2)
the element type of the returned collection.
the traversable to append.
a new array which contains all elements of this array
followed by all elements of that
.
As with ++
, returns a new collection containing the elements from the
left operand followed by the elements from the right operand.
As with ++
, returns a new collection containing the elements from the
left operand followed by the elements from the right operand.
It differs from ++
in that the right operand determines the type of
the resulting collection rather than the left one.
Mnemonic: the COLon is on the side of the new COLlection type.
Example:
scala> val x = List(1) x: List[Int] = List(1) scala> val y = LinkedList(2) y: scala.collection.mutable.LinkedList[Int] = LinkedList(2) scala> val z = x ++: y z: scala.collection.mutable.LinkedList[Int] = LinkedList(1, 2)
This overload exists because: for the implementation of ++:
we should
reuse that of ++
because many collections override it with more
efficient versions.
Since TraversableOnce
has no ++
method, we have to implement that
directly, but Traversable
and down can use the overload.
the element type of the returned collection.
the class of the returned collection. Where possible, That
is
the same class as the current collection class Repr
, but this
depends on the element type B
being admissible for that class,
which means that an implicit instance of type CanBuildFrom[Repr, B, That]
is found.
the traversable to append.
an implicit value of class CanBuildFrom
which determines the
result class That
from the current representation type Repr
and the new element type B
.
a new collection of type That
which contains all elements
of this mutable indexed sequence followed by all elements of that
.
[use case] As with ++
, returns a new collection containing the elements from the left operand followed by the
elements from the right operand.
As with ++
, returns a new collection containing the elements from the left operand followed by the
elements from the right operand.
It differs from ++
in that the right operand determines the type of
the resulting collection rather than the left one.
Mnemonic: the COLon is on the side of the new COLlection type.
Example:
scala> val x = List(1) x: List[Int] = List(1) scala> val y = LinkedList(2) y: scala.collection.mutable.LinkedList[Int] = LinkedList(2) scala> val z = x ++: y z: scala.collection.mutable.LinkedList[Int] = LinkedList(1, 2)
the element type of the returned collection.
the traversable to append.
a new array which contains all elements of this array
followed by all elements of that
.
As with ++
, returns a new collection containing the elements from the
left operand followed by the elements from the right operand.
As with ++
, returns a new collection containing the elements from the
left operand followed by the elements from the right operand.
It differs from ++
in that the right operand determines the type of
the resulting collection rather than the left one.
Mnemonic: the COLon is on the side of the new COLlection type.
Example:
scala> val x = List(1) x: List[Int] = List(1) scala> val y = LinkedList(2) y: scala.collection.mutable.LinkedList[Int] = LinkedList(2) scala> val z = x ++: y z: scala.collection.mutable.LinkedList[Int] = LinkedList(1, 2)
This overload exists because: for the implementation of ++:
we should
reuse that of ++
because many collections override it with more
efficient versions.
Since TraversableOnce
has no ++
method, we have to implement that
directly, but Traversable
and down can use the overload.
the element type of the returned collection.
the class of the returned collection. Where possible, That
is
the same class as the current collection class Repr
, but this
depends on the element type B
being admissible for that class,
which means that an implicit instance of type CanBuildFrom[Repr, B, That]
is found.
the traversable to append.
an implicit value of class CanBuildFrom
which determines the
result class That
from the current representation type Repr
and the new element type B
.
a new collection of type That
which contains all elements
of this mutable indexed sequence followed by all elements of that
.
[use case] As with ++
, returns a new collection containing the elements from the left operand followed by the
elements from the right operand.
As with ++
, returns a new collection containing the elements from the left operand followed by the
elements from the right operand.
It differs from ++
in that the right operand determines the type of
the resulting collection rather than the left one.
Mnemonic: the COLon is on the side of the new COLlection type.
Example:
scala> val x = List(1) x: List[Int] = List(1) scala> val y = LinkedList(2) y: scala.collection.mutable.LinkedList[Int] = LinkedList(2) scala> val z = x ++: y z: scala.collection.mutable.LinkedList[Int] = LinkedList(1, 2)
the element type of the returned collection.
the traversable to append.
a new array which contains all elements of this array
followed by all elements of that
.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
Note: /:
is alternate syntax for foldLeft
; z /: xs
is the same as
xs foldLeft z
.
Examples:
Note that the folding function used to compute b is equivalent to that used to compute c.
scala> val a = List(1,2,3,4) a: List[Int] = List(1, 2, 3, 4) scala> val b = (5 /: a)(_+_) b: Int = 15 scala> val c = (5 /: a)((x,y) => x + y) c: Int = 15
the result type of the binary operator.
the start value.
the binary operator.
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going left to right with the start value z
on the left:
op(...op(op(z, x_1), x_2), ..., x_n)
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
Note: /:
is alternate syntax for foldLeft
; z /: xs
is the same as
xs foldLeft z
.
Examples:
Note that the folding function used to compute b is equivalent to that used to compute c.
scala> val a = List(1,2,3,4) a: List[Int] = List(1, 2, 3, 4) scala> val b = (5 /: a)(_+_) b: Int = 15 scala> val c = (5 /: a)((x,y) => x + y) c: Int = 15
the result type of the binary operator.
the start value.
the binary operator.
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going left to right with the start value z
on the left:
op(...op(op(z, x_1), x_2), ..., x_n)
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
Note: /:
is alternate syntax for foldLeft
; z /: xs
is the same as
xs foldLeft z
.
Examples:
Note that the folding function used to compute b is equivalent to that used to compute c.
scala> val a = List(1,2,3,4) a: List[Int] = List(1, 2, 3, 4) scala> val b = (5 /: a)(_+_) b: Int = 15 scala> val c = (5 /: a)((x,y) => x + y) c: Int = 15
the result type of the binary operator.
the start value.
the binary operator.
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going left to right with the start value z
on the left:
op(...op(op(z, x_1), x_2), ..., x_n)
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
Note: /:
is alternate syntax for foldLeft
; z /: xs
is the same as
xs foldLeft z
.
Examples:
Note that the folding function used to compute b is equivalent to that used to compute c.
scala> val a = List(1,2,3,4) a: List[Int] = List(1, 2, 3, 4) scala> val b = (5 /: a)(_+_) b: Int = 15 scala> val c = (5 /: a)((x,y) => x + y) c: Int = 15
the result type of the binary operator.
the start value.
the binary operator.
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going left to right with the start value z
on the left:
op(...op(op(z, x_1), x_2), ..., x_n)
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
Note: /:
is alternate syntax for foldLeft
; z /: xs
is the same as
xs foldLeft z
.
Examples:
Note that the folding function used to compute b is equivalent to that used to compute c.
scala> val a = List(1,2,3,4) a: List[Int] = List(1, 2, 3, 4) scala> val b = (5 /: a)(_+_) b: Int = 15 scala> val c = (5 /: a)((x,y) => x + y) c: Int = 15
the result type of the binary operator.
the start value.
the binary operator.
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going left to right with the start value z
on the left:
op(...op(op(z, x_1), x_2), ..., x_n)
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
Note: /:
is alternate syntax for foldLeft
; z /: xs
is the same as
xs foldLeft z
.
Examples:
Note that the folding function used to compute b is equivalent to that used to compute c.
scala> val a = List(1,2,3,4) a: List[Int] = List(1, 2, 3, 4) scala> val b = (5 /: a)(_+_) b: Int = 15 scala> val c = (5 /: a)((x,y) => x + y) c: Int = 15
the result type of the binary operator.
the start value.
the binary operator.
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going left to right with the start value z
on the left:
op(...op(op(z, x_1), x_2), ..., x_n)
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
Note: /:
is alternate syntax for foldLeft
; z /: xs
is the same as
xs foldLeft z
.
Examples:
Note that the folding function used to compute b is equivalent to that used to compute c.
scala> val a = List(1,2,3,4) a: List[Int] = List(1, 2, 3, 4) scala> val b = (5 /: a)(_+_) b: Int = 15 scala> val c = (5 /: a)((x,y) => x + y) c: Int = 15
the result type of the binary operator.
the start value.
the binary operator.
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going left to right with the start value z
on the left:
op(...op(op(z, x_1), x_2), ..., x_n)
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
Note: /:
is alternate syntax for foldLeft
; z /: xs
is the same as
xs foldLeft z
.
Examples:
Note that the folding function used to compute b is equivalent to that used to compute c.
scala> val a = List(1,2,3,4) a: List[Int] = List(1, 2, 3, 4) scala> val b = (5 /: a)(_+_) b: Int = 15 scala> val c = (5 /: a)((x,y) => x + y) c: Int = 15
the result type of the binary operator.
the start value.
the binary operator.
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going left to right with the start value z
on the left:
op(...op(op(z, x_1), x_2), ..., x_n)
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
Note: /:
is alternate syntax for foldLeft
; z /: xs
is the same as
xs foldLeft z
.
Examples:
Note that the folding function used to compute b is equivalent to that used to compute c.
scala> val a = List(1,2,3,4) a: List[Int] = List(1, 2, 3, 4) scala> val b = (5 /: a)(_+_) b: Int = 15 scala> val c = (5 /: a)((x,y) => x + y) c: Int = 15
the result type of the binary operator.
the start value.
the binary operator.
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going left to right with the start value z
on the left:
op(...op(op(z, x_1), x_2), ..., x_n)
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
Note: :\
is alternate syntax for foldRight
; xs :\ z
is the same as
xs foldRight z
.
Examples:
Note that the folding function used to compute b is equivalent to that used to compute c.
scala> val a = List(1,2,3,4) a: List[Int] = List(1, 2, 3, 4) scala> val b = (a :\ 5)(_+_) b: Int = 15 scala> val c = (a :\ 5)((x,y) => x + y) c: Int = 15
the result type of the binary operator.
the start value
the binary operator
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going right to left with the start value z
on the right:
op(x_1, op(x_2, ... op(x_n, z)...))
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
Note: :\
is alternate syntax for foldRight
; xs :\ z
is the same as
xs foldRight z
.
Examples:
Note that the folding function used to compute b is equivalent to that used to compute c.
scala> val a = List(1,2,3,4) a: List[Int] = List(1, 2, 3, 4) scala> val b = (a :\ 5)(_+_) b: Int = 15 scala> val c = (a :\ 5)((x,y) => x + y) c: Int = 15
the result type of the binary operator.
the start value
the binary operator
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going right to left with the start value z
on the right:
op(x_1, op(x_2, ... op(x_n, z)...))
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
Note: :\
is alternate syntax for foldRight
; xs :\ z
is the same as
xs foldRight z
.
Examples:
Note that the folding function used to compute b is equivalent to that used to compute c.
scala> val a = List(1,2,3,4) a: List[Int] = List(1, 2, 3, 4) scala> val b = (a :\ 5)(_+_) b: Int = 15 scala> val c = (a :\ 5)((x,y) => x + y) c: Int = 15
the result type of the binary operator.
the start value
the binary operator
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going right to left with the start value z
on the right:
op(x_1, op(x_2, ... op(x_n, z)...))
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
Note: :\
is alternate syntax for foldRight
; xs :\ z
is the same as
xs foldRight z
.
Examples:
Note that the folding function used to compute b is equivalent to that used to compute c.
scala> val a = List(1,2,3,4) a: List[Int] = List(1, 2, 3, 4) scala> val b = (a :\ 5)(_+_) b: Int = 15 scala> val c = (a :\ 5)((x,y) => x + y) c: Int = 15
the result type of the binary operator.
the start value
the binary operator
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going right to left with the start value z
on the right:
op(x_1, op(x_2, ... op(x_n, z)...))
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
Note: :\
is alternate syntax for foldRight
; xs :\ z
is the same as
xs foldRight z
.
Examples:
Note that the folding function used to compute b is equivalent to that used to compute c.
scala> val a = List(1,2,3,4) a: List[Int] = List(1, 2, 3, 4) scala> val b = (a :\ 5)(_+_) b: Int = 15 scala> val c = (a :\ 5)((x,y) => x + y) c: Int = 15
the result type of the binary operator.
the start value
the binary operator
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going right to left with the start value z
on the right:
op(x_1, op(x_2, ... op(x_n, z)...))
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
Note: :\
is alternate syntax for foldRight
; xs :\ z
is the same as
xs foldRight z
.
Examples:
Note that the folding function used to compute b is equivalent to that used to compute c.
scala> val a = List(1,2,3,4) a: List[Int] = List(1, 2, 3, 4) scala> val b = (a :\ 5)(_+_) b: Int = 15 scala> val c = (a :\ 5)((x,y) => x + y) c: Int = 15
the result type of the binary operator.
the start value
the binary operator
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going right to left with the start value z
on the right:
op(x_1, op(x_2, ... op(x_n, z)...))
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
Note: :\
is alternate syntax for foldRight
; xs :\ z
is the same as
xs foldRight z
.
Examples:
Note that the folding function used to compute b is equivalent to that used to compute c.
scala> val a = List(1,2,3,4) a: List[Int] = List(1, 2, 3, 4) scala> val b = (a :\ 5)(_+_) b: Int = 15 scala> val c = (a :\ 5)((x,y) => x + y) c: Int = 15
the result type of the binary operator.
the start value
the binary operator
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going right to left with the start value z
on the right:
op(x_1, op(x_2, ... op(x_n, z)...))
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
Note: :\
is alternate syntax for foldRight
; xs :\ z
is the same as
xs foldRight z
.
Examples:
Note that the folding function used to compute b is equivalent to that used to compute c.
scala> val a = List(1,2,3,4) a: List[Int] = List(1, 2, 3, 4) scala> val b = (a :\ 5)(_+_) b: Int = 15 scala> val c = (a :\ 5)((x,y) => x + y) c: Int = 15
the result type of the binary operator.
the start value
the binary operator
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going right to left with the start value z
on the right:
op(x_1, op(x_2, ... op(x_n, z)...))
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
Note: :\
is alternate syntax for foldRight
; xs :\ z
is the same as
xs foldRight z
.
Examples:
Note that the folding function used to compute b is equivalent to that used to compute c.
scala> val a = List(1,2,3,4) a: List[Int] = List(1, 2, 3, 4) scala> val b = (a :\ 5)(_+_) b: Int = 15 scala> val c = (a :\ 5)((x,y) => x + y) c: Int = 15
the result type of the binary operator.
the start value
the binary operator
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going right to left with the start value z
on the right:
op(x_1, op(x_2, ... op(x_n, z)...))
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
The expression x == that
is equivalent to if (x eq null) that eq null else x.equals(that)
.
The expression x == that
is equivalent to if (x eq null) that eq null else x.equals(that)
.
true
if the receiver object is equivalent to the argument; false
otherwise.
Aggregates the results of applying an operator to subsequent elements.
Aggregates the results of applying an operator to subsequent elements.
This is a more general form of fold
and reduce
. It has similar
semantics, but does not require the result to be a supertype of the
element type. It traverses the elements in different partitions
sequentially, using seqop
to update the result, and then applies
combop
to results from different partitions. The implementation of
this operation may operate on an arbitrary number of collection
partitions, so combop
may be invoked an arbitrary number of times.
For example, one might want to process some elements and then produce
a Set
. In this case, seqop
would process an element and append it
to the list, while combop
would concatenate two lists from different
partitions together. The initial value z
would be an empty set.
pc.aggregate(Set[Int]())(_ += process(_), _ ++ _)
Another example is calculating geometric mean from a collection of doubles (one would typically require big doubles for this).
the type of accumulated results
the initial value for the accumulated result of the partition - this
will typically be the neutral element for the seqop
operator (e.g.
Nil
for list concatenation or 0
for summation) and may be evaluated
more than once
an operator used to accumulate results within a partition
an associative operator used to combine results from different partitions
Aggregates the results of applying an operator to subsequent elements.
Aggregates the results of applying an operator to subsequent elements.
This is a more general form of fold
and reduce
. It has similar
semantics, but does not require the result to be a supertype of the
element type. It traverses the elements in different partitions
sequentially, using seqop
to update the result, and then applies
combop
to results from different partitions. The implementation of
this operation may operate on an arbitrary number of collection
partitions, so combop
may be invoked an arbitrary number of times.
For example, one might want to process some elements and then produce
a Set
. In this case, seqop
would process an element and append it
to the list, while combop
would concatenate two lists from different
partitions together. The initial value z
would be an empty set.
pc.aggregate(Set[Int]())(_ += process(_), _ ++ _)
Another example is calculating geometric mean from a collection of doubles (one would typically require big doubles for this).
the type of accumulated results
the initial value for the accumulated result of the partition - this
will typically be the neutral element for the seqop
operator (e.g.
Nil
for list concatenation or 0
for summation) and may be evaluated
more than once
an operator used to accumulate results within a partition
an associative operator used to combine results from different partitions
Aggregates the results of applying an operator to subsequent elements.
Aggregates the results of applying an operator to subsequent elements.
This is a more general form of fold
and reduce
. It has similar
semantics, but does not require the result to be a supertype of the
element type. It traverses the elements in different partitions
sequentially, using seqop
to update the result, and then applies
combop
to results from different partitions. The implementation of
this operation may operate on an arbitrary number of collection
partitions, so combop
may be invoked an arbitrary number of times.
For example, one might want to process some elements and then produce
a Set
. In this case, seqop
would process an element and append it
to the list, while combop
would concatenate two lists from different
partitions together. The initial value z
would be an empty set.
pc.aggregate(Set[Int]())(_ += process(_), _ ++ _)
Another example is calculating geometric mean from a collection of doubles (one would typically require big doubles for this).
the type of accumulated results
the initial value for the accumulated result of the partition - this
will typically be the neutral element for the seqop
operator (e.g.
Nil
for list concatenation or 0
for summation) and may be evaluated
more than once
an operator used to accumulate results within a partition
an associative operator used to combine results from different partitions
Aggregates the results of applying an operator to subsequent elements.
Aggregates the results of applying an operator to subsequent elements.
This is a more general form of fold
and reduce
. It has similar
semantics, but does not require the result to be a supertype of the
element type. It traverses the elements in different partitions
sequentially, using seqop
to update the result, and then applies
combop
to results from different partitions. The implementation of
this operation may operate on an arbitrary number of collection
partitions, so combop
may be invoked an arbitrary number of times.
For example, one might want to process some elements and then produce
a Set
. In this case, seqop
would process an element and append it
to the list, while combop
would concatenate two lists from different
partitions together. The initial value z
would be an empty set.
pc.aggregate(Set[Int]())(_ += process(_), _ ++ _)
Another example is calculating geometric mean from a collection of doubles (one would typically require big doubles for this).
the type of accumulated results
the initial value for the accumulated result of the partition - this
will typically be the neutral element for the seqop
operator (e.g.
Nil
for list concatenation or 0
for summation) and may be evaluated
more than once
an operator used to accumulate results within a partition
an associative operator used to combine results from different partitions
Aggregates the results of applying an operator to subsequent elements.
Aggregates the results of applying an operator to subsequent elements.
This is a more general form of fold
and reduce
. It has similar
semantics, but does not require the result to be a supertype of the
element type. It traverses the elements in different partitions
sequentially, using seqop
to update the result, and then applies
combop
to results from different partitions. The implementation of
this operation may operate on an arbitrary number of collection
partitions, so combop
may be invoked an arbitrary number of times.
For example, one might want to process some elements and then produce
a Set
. In this case, seqop
would process an element and append it
to the list, while combop
would concatenate two lists from different
partitions together. The initial value z
would be an empty set.
pc.aggregate(Set[Int]())(_ += process(_), _ ++ _)
Another example is calculating geometric mean from a collection of doubles (one would typically require big doubles for this).
the type of accumulated results
the initial value for the accumulated result of the partition - this
will typically be the neutral element for the seqop
operator (e.g.
Nil
for list concatenation or 0
for summation) and may be evaluated
more than once
an operator used to accumulate results within a partition
an associative operator used to combine results from different partitions
Aggregates the results of applying an operator to subsequent elements.
Aggregates the results of applying an operator to subsequent elements.
This is a more general form of fold
and reduce
. It has similar
semantics, but does not require the result to be a supertype of the
element type. It traverses the elements in different partitions
sequentially, using seqop
to update the result, and then applies
combop
to results from different partitions. The implementation of
this operation may operate on an arbitrary number of collection
partitions, so combop
may be invoked an arbitrary number of times.
For example, one might want to process some elements and then produce
a Set
. In this case, seqop
would process an element and append it
to the list, while combop
would concatenate two lists from different
partitions together. The initial value z
would be an empty set.
pc.aggregate(Set[Int]())(_ += process(_), _ ++ _)
Another example is calculating geometric mean from a collection of doubles (one would typically require big doubles for this).
the type of accumulated results
the initial value for the accumulated result of the partition - this
will typically be the neutral element for the seqop
operator (e.g.
Nil
for list concatenation or 0
for summation) and may be evaluated
more than once
an operator used to accumulate results within a partition
an associative operator used to combine results from different partitions
Aggregates the results of applying an operator to subsequent elements.
Aggregates the results of applying an operator to subsequent elements.
This is a more general form of fold
and reduce
. It has similar
semantics, but does not require the result to be a supertype of the
element type. It traverses the elements in different partitions
sequentially, using seqop
to update the result, and then applies
combop
to results from different partitions. The implementation of
this operation may operate on an arbitrary number of collection
partitions, so combop
may be invoked an arbitrary number of times.
For example, one might want to process some elements and then produce
a Set
. In this case, seqop
would process an element and append it
to the list, while combop
would concatenate two lists from different
partitions together. The initial value z
would be an empty set.
pc.aggregate(Set[Int]())(_ += process(_), _ ++ _)
Another example is calculating geometric mean from a collection of doubles (one would typically require big doubles for this).
the type of accumulated results
the initial value for the accumulated result of the partition - this
will typically be the neutral element for the seqop
operator (e.g.
Nil
for list concatenation or 0
for summation) and may be evaluated
more than once
an operator used to accumulate results within a partition
an associative operator used to combine results from different partitions
Aggregates the results of applying an operator to subsequent elements.
Aggregates the results of applying an operator to subsequent elements.
This is a more general form of fold
and reduce
. It has similar
semantics, but does not require the result to be a supertype of the
element type. It traverses the elements in different partitions
sequentially, using seqop
to update the result, and then applies
combop
to results from different partitions. The implementation of
this operation may operate on an arbitrary number of collection
partitions, so combop
may be invoked an arbitrary number of times.
For example, one might want to process some elements and then produce
a Set
. In this case, seqop
would process an element and append it
to the list, while combop
would concatenate two lists from different
partitions together. The initial value z
would be an empty set.
pc.aggregate(Set[Int]())(_ += process(_), _ ++ _)
Another example is calculating geometric mean from a collection of doubles (one would typically require big doubles for this).
the type of accumulated results
the initial value for the accumulated result of the partition - this
will typically be the neutral element for the seqop
operator (e.g.
Nil
for list concatenation or 0
for summation) and may be evaluated
more than once
an operator used to accumulate results within a partition
an associative operator used to combine results from different partitions
Aggregates the results of applying an operator to subsequent elements.
Aggregates the results of applying an operator to subsequent elements.
This is a more general form of fold
and reduce
. It has similar
semantics, but does not require the result to be a supertype of the
element type. It traverses the elements in different partitions
sequentially, using seqop
to update the result, and then applies
combop
to results from different partitions. The implementation of
this operation may operate on an arbitrary number of collection
partitions, so combop
may be invoked an arbitrary number of times.
For example, one might want to process some elements and then produce
a Set
. In this case, seqop
would process an element and append it
to the list, while combop
would concatenate two lists from different
partitions together. The initial value z
would be an empty set.
pc.aggregate(Set[Int]())(_ += process(_), _ ++ _)
Another example is calculating geometric mean from a collection of doubles (one would typically require big doubles for this).
the type of accumulated results
the initial value for the accumulated result of the partition - this
will typically be the neutral element for the seqop
operator (e.g.
Nil
for list concatenation or 0
for summation) and may be evaluated
more than once
an operator used to accumulate results within a partition
an associative operator used to combine results from different partitions
The element at given index.
The element at given index.
Indices start at 0
; xs.apply(0)
is the first element of array xs
.
Note the indexing syntax xs(i)
is a shorthand for xs.apply(i)
.
the index
the element at the given index
ArrayIndexOutOfBoundsException
if i < 0
or length <= i
Cast the receiver object to be of type T0
.
Cast the receiver object to be of type T0
.
Note that the success of a cast at runtime is modulo Scala's erasure semantics.
Therefore the expression 1.asInstanceOf[String]
will throw a ClassCastException
at
runtime, while the expression List(1).asInstanceOf[List[String]]
will not.
In the latter example, because the type argument is erased as part of compilation it is
not possible to check whether the contents of the list are of the requested type.
the receiver object.
ClassCastException
if the receiver object is not an instance of the erasure of type T0
.
Clone the Array.
[use case] Builds a new collection by applying a partial function to all elements of this array on which the function is defined.
Builds a new collection by applying a partial function to all elements of this array on which the function is defined.
the element type of the returned collection.
the partial function which filters and maps the array.
a new array resulting from applying the given partial function
pf
to each element on which it is defined and collecting the results.
The order of the elements is preserved.
[use case] Builds a new collection by applying a partial function to all elements of this array on which the function is defined.
Builds a new collection by applying a partial function to all elements of this array on which the function is defined.
the element type of the returned collection.
the partial function which filters and maps the array.
a new array resulting from applying the given partial function
pf
to each element on which it is defined and collecting the results.
The order of the elements is preserved.
[use case] Builds a new collection by applying a partial function to all elements of this array on which the function is defined.
Builds a new collection by applying a partial function to all elements of this array on which the function is defined.
the element type of the returned collection.
the partial function which filters and maps the array.
a new array resulting from applying the given partial function
pf
to each element on which it is defined and collecting the results.
The order of the elements is preserved.
[use case] Builds a new collection by applying a partial function to all elements of this array on which the function is defined.
Builds a new collection by applying a partial function to all elements of this array on which the function is defined.
the element type of the returned collection.
the partial function which filters and maps the array.
a new array resulting from applying the given partial function
pf
to each element on which it is defined and collecting the results.
The order of the elements is preserved.
[use case] Builds a new collection by applying a partial function to all elements of this array on which the function is defined.
Builds a new collection by applying a partial function to all elements of this array on which the function is defined.
the element type of the returned collection.
the partial function which filters and maps the array.
a new array resulting from applying the given partial function
pf
to each element on which it is defined and collecting the results.
The order of the elements is preserved.
[use case] Builds a new collection by applying a partial function to all elements of this array on which the function is defined.
Builds a new collection by applying a partial function to all elements of this array on which the function is defined.
the element type of the returned collection.
the partial function which filters and maps the array.
a new array resulting from applying the given partial function
pf
to each element on which it is defined and collecting the results.
The order of the elements is preserved.
[use case] Builds a new collection by applying a partial function to all elements of this array on which the function is defined.
Builds a new collection by applying a partial function to all elements of this array on which the function is defined.
the element type of the returned collection.
the partial function which filters and maps the array.
a new array resulting from applying the given partial function
pf
to each element on which it is defined and collecting the results.
The order of the elements is preserved.
[use case] Builds a new collection by applying a partial function to all elements of this array on which the function is defined.
Builds a new collection by applying a partial function to all elements of this array on which the function is defined.
the element type of the returned collection.
the partial function which filters and maps the array.
a new array resulting from applying the given partial function
pf
to each element on which it is defined and collecting the results.
The order of the elements is preserved.
[use case] Builds a new collection by applying a partial function to all elements of this array on which the function is defined.
Builds a new collection by applying a partial function to all elements of this array on which the function is defined.
the element type of the returned collection.
the partial function which filters and maps the array.
a new array resulting from applying the given partial function
pf
to each element on which it is defined and collecting the results.
The order of the elements is preserved.
[use case] Builds a new collection by applying a partial function to all elements of this array on which the function is defined.
Builds a new collection by applying a partial function to all elements of this array on which the function is defined.
the element type of the returned collection.
the partial function which filters and maps the array.
a new array resulting from applying the given partial function
pf
to each element on which it is defined and collecting the results.
The order of the elements is preserved.
[use case] Builds a new collection by applying a partial function to all elements of this array on which the function is defined.
Builds a new collection by applying a partial function to all elements of this array on which the function is defined.
the element type of the returned collection.
the partial function which filters and maps the array.
a new array resulting from applying the given partial function
pf
to each element on which it is defined and collecting the results.
The order of the elements is preserved.
Finds the first element of the mutable indexed sequence for which the given partial function is defined, and applies the partial function to it.
Finds the first element of the mutable indexed sequence for which the given partial function is defined, and applies the partial function to it.
the partial function
an option value containing pf applied to the first
value for which it is defined, or None
if none exists.
Seq("a", 1, 5L).collectFirst({ case x: Int => x*10 }) = Some(10)
Finds the first element of the mutable indexed sequence for which the given partial function is defined, and applies the partial function to it.
Finds the first element of the mutable indexed sequence for which the given partial function is defined, and applies the partial function to it.
the partial function
an option value containing pf applied to the first
value for which it is defined, or None
if none exists.
Seq("a", 1, 5L).collectFirst({ case x: Int => x*10 }) = Some(10)
Finds the first element of the mutable indexed sequence for which the given partial function is defined, and applies the partial function to it.
Finds the first element of the mutable indexed sequence for which the given partial function is defined, and applies the partial function to it.
the partial function
an option value containing pf applied to the first
value for which it is defined, or None
if none exists.
Seq("a", 1, 5L).collectFirst({ case x: Int => x*10 }) = Some(10)
Finds the first element of the mutable indexed sequence for which the given partial function is defined, and applies the partial function to it.
Finds the first element of the mutable indexed sequence for which the given partial function is defined, and applies the partial function to it.
the partial function
an option value containing pf applied to the first
value for which it is defined, or None
if none exists.
Seq("a", 1, 5L).collectFirst({ case x: Int => x*10 }) = Some(10)
Finds the first element of the mutable indexed sequence for which the given partial function is defined, and applies the partial function to it.
Finds the first element of the mutable indexed sequence for which the given partial function is defined, and applies the partial function to it.
the partial function
an option value containing pf applied to the first
value for which it is defined, or None
if none exists.
Seq("a", 1, 5L).collectFirst({ case x: Int => x*10 }) = Some(10)
Finds the first element of the mutable indexed sequence for which the given partial function is defined, and applies the partial function to it.
Finds the first element of the mutable indexed sequence for which the given partial function is defined, and applies the partial function to it.
the partial function
an option value containing pf applied to the first
value for which it is defined, or None
if none exists.
Seq("a", 1, 5L).collectFirst({ case x: Int => x*10 }) = Some(10)
Finds the first element of the mutable indexed sequence for which the given partial function is defined, and applies the partial function to it.
Finds the first element of the mutable indexed sequence for which the given partial function is defined, and applies the partial function to it.
the partial function
an option value containing pf applied to the first
value for which it is defined, or None
if none exists.
Seq("a", 1, 5L).collectFirst({ case x: Int => x*10 }) = Some(10)
Finds the first element of the mutable indexed sequence for which the given partial function is defined, and applies the partial function to it.
Finds the first element of the mutable indexed sequence for which the given partial function is defined, and applies the partial function to it.
the partial function
an option value containing pf applied to the first
value for which it is defined, or None
if none exists.
Seq("a", 1, 5L).collectFirst({ case x: Int => x*10 }) = Some(10)
Finds the first element of the mutable indexed sequence for which the given partial function is defined, and applies the partial function to it.
Finds the first element of the mutable indexed sequence for which the given partial function is defined, and applies the partial function to it.
the partial function
an option value containing pf applied to the first
value for which it is defined, or None
if none exists.
Seq("a", 1, 5L).collectFirst({ case x: Int => x*10 }) = Some(10)
Tests whether this mutable indexed sequence contains a given value as an element.
Tests whether this mutable indexed sequence contains a given value as an element.
the element to test.
true
if this mutable indexed sequence has an element that is equal (as
determined by ==
) to elem
, false
otherwise.
Tests whether this mutable indexed sequence contains a given value as an element.
Tests whether this mutable indexed sequence contains a given value as an element.
the element to test.
true
if this mutable indexed sequence has an element that is equal (as
determined by ==
) to elem
, false
otherwise.
Tests whether this mutable indexed sequence contains a given value as an element.
Tests whether this mutable indexed sequence contains a given value as an element.
the element to test.
true
if this mutable indexed sequence has an element that is equal (as
determined by ==
) to elem
, false
otherwise.
Tests whether this mutable indexed sequence contains a given value as an element.
Tests whether this mutable indexed sequence contains a given value as an element.
the element to test.
true
if this mutable indexed sequence has an element that is equal (as
determined by ==
) to elem
, false
otherwise.
Tests whether this mutable indexed sequence contains a given value as an element.
Tests whether this mutable indexed sequence contains a given value as an element.
the element to test.
true
if this mutable indexed sequence has an element that is equal (as
determined by ==
) to elem
, false
otherwise.
Tests whether this mutable indexed sequence contains a given value as an element.
Tests whether this mutable indexed sequence contains a given value as an element.
the element to test.
true
if this mutable indexed sequence has an element that is equal (as
determined by ==
) to elem
, false
otherwise.
Tests whether this mutable indexed sequence contains a given value as an element.
Tests whether this mutable indexed sequence contains a given value as an element.
the element to test.
true
if this mutable indexed sequence has an element that is equal (as
determined by ==
) to elem
, false
otherwise.
Tests whether this mutable indexed sequence contains a given value as an element.
Tests whether this mutable indexed sequence contains a given value as an element.
the element to test.
true
if this mutable indexed sequence has an element that is equal (as
determined by ==
) to elem
, false
otherwise.
Tests whether this mutable indexed sequence contains a given value as an element.
Tests whether this mutable indexed sequence contains a given value as an element.
the element to test.
true
if this mutable indexed sequence has an element that is equal (as
determined by ==
) to elem
, false
otherwise.
Tests whether this mutable indexed sequence contains a given value as an element.
Tests whether this mutable indexed sequence contains a given value as an element.
the element to test.
true
if this mutable indexed sequence has an element that is equal (as
determined by ==
) to elem
, false
otherwise.
Tests whether this mutable indexed sequence contains a given value as an element.
Tests whether this mutable indexed sequence contains a given value as an element.
the element to test.
true
if this mutable indexed sequence has an element that is equal (as
determined by ==
) to elem
, false
otherwise.
Copies all elements of this mutable indexed sequence to a buffer.
Copies all elements of this mutable indexed sequence to a buffer.
The buffer to which elements are copied.
Copies all elements of this mutable indexed sequence to a buffer.
Copies all elements of this mutable indexed sequence to a buffer.
The buffer to which elements are copied.
Copies all elements of this mutable indexed sequence to a buffer.
Copies all elements of this mutable indexed sequence to a buffer.
The buffer to which elements are copied.
Copies all elements of this mutable indexed sequence to a buffer.
Copies all elements of this mutable indexed sequence to a buffer.
The buffer to which elements are copied.
Copies all elements of this mutable indexed sequence to a buffer.
Copies all elements of this mutable indexed sequence to a buffer.
The buffer to which elements are copied.
Copies all elements of this mutable indexed sequence to a buffer.
Copies all elements of this mutable indexed sequence to a buffer.
The buffer to which elements are copied.
Copies all elements of this mutable indexed sequence to a buffer.
Copies all elements of this mutable indexed sequence to a buffer.
The buffer to which elements are copied.
Copies all elements of this mutable indexed sequence to a buffer.
Copies all elements of this mutable indexed sequence to a buffer.
The buffer to which elements are copied.
Copies all elements of this mutable indexed sequence to a buffer.
Copies all elements of this mutable indexed sequence to a buffer.
The buffer to which elements are copied.
Copies all elements of this mutable indexed sequence to a buffer.
Copies all elements of this mutable indexed sequence to a buffer.
The buffer to which elements are copied.
Copies all elements of this mutable indexed sequence to a buffer.
Copies all elements of this mutable indexed sequence to a buffer.
The buffer to which elements are copied.
Tests whether every element of this mutable indexed sequence relates to the corresponding element of another sequence by satisfying a test predicate.
Tests whether every element of this mutable indexed sequence relates to the corresponding element of another sequence by satisfying a test predicate.
the type of the elements of that
the other sequence
the test predicate, which relates elements from both sequences
true
if both sequences have the same length and
p(x, y)
is true
for all corresponding elements x
of this mutable indexed sequence
and y
of that
, otherwise false
.
Tests whether every element of this mutable indexed sequence relates to the corresponding element of another sequence by satisfying a test predicate.
Tests whether every element of this mutable indexed sequence relates to the corresponding element of another sequence by satisfying a test predicate.
the type of the elements of that
the other sequence
the test predicate, which relates elements from both sequences
true
if both sequences have the same length and
p(x, y)
is true
for all corresponding elements x
of this mutable indexed sequence
and y
of that
, otherwise false
.
Tests whether every element of this mutable indexed sequence relates to the corresponding element of another sequence by satisfying a test predicate.
Tests whether every element of this mutable indexed sequence relates to the corresponding element of another sequence by satisfying a test predicate.
the type of the elements of that
the other sequence
the test predicate, which relates elements from both sequences
true
if both sequences have the same length and
p(x, y)
is true
for all corresponding elements x
of this mutable indexed sequence
and y
of that
, otherwise false
.
Tests whether every element of this mutable indexed sequence relates to the corresponding element of another sequence by satisfying a test predicate.
Tests whether every element of this mutable indexed sequence relates to the corresponding element of another sequence by satisfying a test predicate.
the type of the elements of that
the other sequence
the test predicate, which relates elements from both sequences
true
if both sequences have the same length and
p(x, y)
is true
for all corresponding elements x
of this mutable indexed sequence
and y
of that
, otherwise false
.
Tests whether every element of this mutable indexed sequence relates to the corresponding element of another sequence by satisfying a test predicate.
Tests whether every element of this mutable indexed sequence relates to the corresponding element of another sequence by satisfying a test predicate.
the type of the elements of that
the other sequence
the test predicate, which relates elements from both sequences
true
if both sequences have the same length and
p(x, y)
is true
for all corresponding elements x
of this mutable indexed sequence
and y
of that
, otherwise false
.
Tests whether every element of this mutable indexed sequence relates to the corresponding element of another sequence by satisfying a test predicate.
Tests whether every element of this mutable indexed sequence relates to the corresponding element of another sequence by satisfying a test predicate.
the type of the elements of that
the other sequence
the test predicate, which relates elements from both sequences
true
if both sequences have the same length and
p(x, y)
is true
for all corresponding elements x
of this mutable indexed sequence
and y
of that
, otherwise false
.
Tests whether every element of this mutable indexed sequence relates to the corresponding element of another sequence by satisfying a test predicate.
Tests whether every element of this mutable indexed sequence relates to the corresponding element of another sequence by satisfying a test predicate.
the type of the elements of that
the other sequence
the test predicate, which relates elements from both sequences
true
if both sequences have the same length and
p(x, y)
is true
for all corresponding elements x
of this mutable indexed sequence
and y
of that
, otherwise false
.
Tests whether every element of this mutable indexed sequence relates to the corresponding element of another sequence by satisfying a test predicate.
Tests whether every element of this mutable indexed sequence relates to the corresponding element of another sequence by satisfying a test predicate.
the type of the elements of that
the other sequence
the test predicate, which relates elements from both sequences
true
if both sequences have the same length and
p(x, y)
is true
for all corresponding elements x
of this mutable indexed sequence
and y
of that
, otherwise false
.
Tests whether every element of this mutable indexed sequence relates to the corresponding element of another sequence by satisfying a test predicate.
Tests whether every element of this mutable indexed sequence relates to the corresponding element of another sequence by satisfying a test predicate.
the type of the elements of that
the other sequence
the test predicate, which relates elements from both sequences
true
if both sequences have the same length and
p(x, y)
is true
for all corresponding elements x
of this mutable indexed sequence
and y
of that
, otherwise false
.
Counts the number of elements in the mutable indexed sequence which satisfy a predicate.
Counts the number of elements in the mutable indexed sequence which satisfy a predicate.
the predicate used to test elements.
the number of elements satisfying the predicate p
.
Counts the number of elements in the mutable indexed sequence which satisfy a predicate.
Counts the number of elements in the mutable indexed sequence which satisfy a predicate.
the predicate used to test elements.
the number of elements satisfying the predicate p
.
Counts the number of elements in the mutable indexed sequence which satisfy a predicate.
Counts the number of elements in the mutable indexed sequence which satisfy a predicate.
the predicate used to test elements.
the number of elements satisfying the predicate p
.
Counts the number of elements in the mutable indexed sequence which satisfy a predicate.
Counts the number of elements in the mutable indexed sequence which satisfy a predicate.
the predicate used to test elements.
the number of elements satisfying the predicate p
.
Counts the number of elements in the mutable indexed sequence which satisfy a predicate.
Counts the number of elements in the mutable indexed sequence which satisfy a predicate.
the predicate used to test elements.
the number of elements satisfying the predicate p
.
Counts the number of elements in the mutable indexed sequence which satisfy a predicate.
Counts the number of elements in the mutable indexed sequence which satisfy a predicate.
the predicate used to test elements.
the number of elements satisfying the predicate p
.
Counts the number of elements in the mutable indexed sequence which satisfy a predicate.
Counts the number of elements in the mutable indexed sequence which satisfy a predicate.
the predicate used to test elements.
the number of elements satisfying the predicate p
.
Counts the number of elements in the mutable indexed sequence which satisfy a predicate.
Counts the number of elements in the mutable indexed sequence which satisfy a predicate.
the predicate used to test elements.
the number of elements satisfying the predicate p
.
Counts the number of elements in the mutable indexed sequence which satisfy a predicate.
Counts the number of elements in the mutable indexed sequence which satisfy a predicate.
the predicate used to test elements.
the number of elements satisfying the predicate p
.
[use case] Computes the multiset difference between this array and another sequence.
Computes the multiset difference between this array and another sequence.
the sequence of elements to remove
a new array which contains all elements of this array
except some of occurrences of elements that also appear in that
.
If an element value x
appears
n times in that
, then the first n occurrences of x
will not form
part of the result, but any following occurrences will.
[use case] Computes the multiset difference between this array and another sequence.
Computes the multiset difference between this array and another sequence.
the sequence of elements to remove
a new array which contains all elements of this array
except some of occurrences of elements that also appear in that
.
If an element value x
appears
n times in that
, then the first n occurrences of x
will not form
part of the result, but any following occurrences will.
[use case] Computes the multiset difference between this array and another sequence.
Computes the multiset difference between this array and another sequence.
the sequence of elements to remove
a new array which contains all elements of this array
except some of occurrences of elements that also appear in that
.
If an element value x
appears
n times in that
, then the first n occurrences of x
will not form
part of the result, but any following occurrences will.
[use case] Computes the multiset difference between this array and another sequence.
Computes the multiset difference between this array and another sequence.
the sequence of elements to remove
a new array which contains all elements of this array
except some of occurrences of elements that also appear in that
.
If an element value x
appears
n times in that
, then the first n occurrences of x
will not form
part of the result, but any following occurrences will.
[use case] Computes the multiset difference between this array and another sequence.
Computes the multiset difference between this array and another sequence.
the sequence of elements to remove
a new array which contains all elements of this array
except some of occurrences of elements that also appear in that
.
If an element value x
appears
n times in that
, then the first n occurrences of x
will not form
part of the result, but any following occurrences will.
[use case] Computes the multiset difference between this array and another sequence.
Computes the multiset difference between this array and another sequence.
the sequence of elements to remove
a new array which contains all elements of this array
except some of occurrences of elements that also appear in that
.
If an element value x
appears
n times in that
, then the first n occurrences of x
will not form
part of the result, but any following occurrences will.
[use case] Computes the multiset difference between this array and another sequence.
Computes the multiset difference between this array and another sequence.
the sequence of elements to remove
a new array which contains all elements of this array
except some of occurrences of elements that also appear in that
.
If an element value x
appears
n times in that
, then the first n occurrences of x
will not form
part of the result, but any following occurrences will.
[use case] Computes the multiset difference between this array and another sequence.
Computes the multiset difference between this array and another sequence.
the sequence of elements to remove
a new array which contains all elements of this array
except some of occurrences of elements that also appear in that
.
If an element value x
appears
n times in that
, then the first n occurrences of x
will not form
part of the result, but any following occurrences will.
[use case] Computes the multiset difference between this array and another sequence.
Computes the multiset difference between this array and another sequence.
the sequence of elements to remove
a new array which contains all elements of this array
except some of occurrences of elements that also appear in that
.
If an element value x
appears
n times in that
, then the first n occurrences of x
will not form
part of the result, but any following occurrences will.
Drops longest prefix of elements that satisfy a predicate.
Drops longest prefix of elements that satisfy a predicate.
the longest suffix of this mutable indexed sequence whose first element
does not satisfy the predicate p
.
Drops longest prefix of elements that satisfy a predicate.
Drops longest prefix of elements that satisfy a predicate.
the longest suffix of this mutable indexed sequence whose first element
does not satisfy the predicate p
.
Drops longest prefix of elements that satisfy a predicate.
Drops longest prefix of elements that satisfy a predicate.
the longest suffix of this mutable indexed sequence whose first element
does not satisfy the predicate p
.
Drops longest prefix of elements that satisfy a predicate.
Drops longest prefix of elements that satisfy a predicate.
the longest suffix of this mutable indexed sequence whose first element
does not satisfy the predicate p
.
Drops longest prefix of elements that satisfy a predicate.
Drops longest prefix of elements that satisfy a predicate.
the longest suffix of this mutable indexed sequence whose first element
does not satisfy the predicate p
.
Drops longest prefix of elements that satisfy a predicate.
Drops longest prefix of elements that satisfy a predicate.
the longest suffix of this mutable indexed sequence whose first element
does not satisfy the predicate p
.
Drops longest prefix of elements that satisfy a predicate.
Drops longest prefix of elements that satisfy a predicate.
the longest suffix of this mutable indexed sequence whose first element
does not satisfy the predicate p
.
Drops longest prefix of elements that satisfy a predicate.
Drops longest prefix of elements that satisfy a predicate.
the longest suffix of this mutable indexed sequence whose first element
does not satisfy the predicate p
.
Drops longest prefix of elements that satisfy a predicate.
Drops longest prefix of elements that satisfy a predicate.
the longest suffix of this mutable indexed sequence whose first element
does not satisfy the predicate p
.
Tests whether the argument (that
) is a reference to the receiver object (this
).
Tests whether the argument (that
) is a reference to the receiver object (this
).
The eq
method implements an equivalence relation on
non-null instances of AnyRef
, and has three additional properties:
x
and y
of type AnyRef
, multiple invocations of
x.eq(y)
consistently returns true
or consistently returns false
.x
of type AnyRef
, x.eq(null)
and null.eq(x)
returns false
.null.eq(null)
returns true
. When overriding the equals
or hashCode
methods, it is important to ensure that their behavior is
consistent with reference equality. Therefore, if two objects are references to each other (o1 eq o2
), they
should be equal to each other (o1 == o2
) and they should hash to the same value (o1.hashCode == o2.hashCode
).
true
if the argument is a reference to the receiver object; false
otherwise.
The equality method for reference types.
Tests whether a predicate holds for some of the elements of this mutable indexed sequence.
Tests whether a predicate holds for some of the elements of this mutable indexed sequence.
the predicate used to test elements.
false
if this mutable indexed sequence is empty, otherwise true
if the given predicate p
holds for some of the elements of this mutable indexed sequence, otherwise false
Tests whether a predicate holds for some of the elements of this mutable indexed sequence.
Tests whether a predicate holds for some of the elements of this mutable indexed sequence.
the predicate used to test elements.
false
if this mutable indexed sequence is empty, otherwise true
if the given predicate p
holds for some of the elements of this mutable indexed sequence, otherwise false
Tests whether a predicate holds for some of the elements of this mutable indexed sequence.
Tests whether a predicate holds for some of the elements of this mutable indexed sequence.
the predicate used to test elements.
false
if this mutable indexed sequence is empty, otherwise true
if the given predicate p
holds for some of the elements of this mutable indexed sequence, otherwise false
Tests whether a predicate holds for some of the elements of this mutable indexed sequence.
Tests whether a predicate holds for some of the elements of this mutable indexed sequence.
the predicate used to test elements.
false
if this mutable indexed sequence is empty, otherwise true
if the given predicate p
holds for some of the elements of this mutable indexed sequence, otherwise false
Tests whether a predicate holds for some of the elements of this mutable indexed sequence.
Tests whether a predicate holds for some of the elements of this mutable indexed sequence.
the predicate used to test elements.
false
if this mutable indexed sequence is empty, otherwise true
if the given predicate p
holds for some of the elements of this mutable indexed sequence, otherwise false
Tests whether a predicate holds for some of the elements of this mutable indexed sequence.
Tests whether a predicate holds for some of the elements of this mutable indexed sequence.
the predicate used to test elements.
false
if this mutable indexed sequence is empty, otherwise true
if the given predicate p
holds for some of the elements of this mutable indexed sequence, otherwise false
Tests whether a predicate holds for some of the elements of this mutable indexed sequence.
Tests whether a predicate holds for some of the elements of this mutable indexed sequence.
the predicate used to test elements.
false
if this mutable indexed sequence is empty, otherwise true
if the given predicate p
holds for some of the elements of this mutable indexed sequence, otherwise false
Tests whether a predicate holds for some of the elements of this mutable indexed sequence.
Tests whether a predicate holds for some of the elements of this mutable indexed sequence.
the predicate used to test elements.
false
if this mutable indexed sequence is empty, otherwise true
if the given predicate p
holds for some of the elements of this mutable indexed sequence, otherwise false
Tests whether a predicate holds for some of the elements of this mutable indexed sequence.
Tests whether a predicate holds for some of the elements of this mutable indexed sequence.
the predicate used to test elements.
false
if this mutable indexed sequence is empty, otherwise true
if the given predicate p
holds for some of the elements of this mutable indexed sequence, otherwise false
Selects all elements of this mutable indexed sequence which satisfy a predicate.
Selects all elements of this mutable indexed sequence which satisfy a predicate.
the predicate used to test elements.
a new mutable indexed sequence consisting of all elements of this mutable indexed sequence that satisfy the given
predicate p
. The order of the elements is preserved.
Selects all elements of this mutable indexed sequence which satisfy a predicate.
Selects all elements of this mutable indexed sequence which satisfy a predicate.
the predicate used to test elements.
a new mutable indexed sequence consisting of all elements of this mutable indexed sequence that satisfy the given
predicate p
. The order of the elements is preserved.
Selects all elements of this mutable indexed sequence which satisfy a predicate.
Selects all elements of this mutable indexed sequence which satisfy a predicate.
the predicate used to test elements.
a new mutable indexed sequence consisting of all elements of this mutable indexed sequence that satisfy the given
predicate p
. The order of the elements is preserved.
Selects all elements of this mutable indexed sequence which satisfy a predicate.
Selects all elements of this mutable indexed sequence which satisfy a predicate.
the predicate used to test elements.
a new mutable indexed sequence consisting of all elements of this mutable indexed sequence that satisfy the given
predicate p
. The order of the elements is preserved.
Selects all elements of this mutable indexed sequence which satisfy a predicate.
Selects all elements of this mutable indexed sequence which satisfy a predicate.
the predicate used to test elements.
a new mutable indexed sequence consisting of all elements of this mutable indexed sequence that satisfy the given
predicate p
. The order of the elements is preserved.
Selects all elements of this mutable indexed sequence which satisfy a predicate.
Selects all elements of this mutable indexed sequence which satisfy a predicate.
the predicate used to test elements.
a new mutable indexed sequence consisting of all elements of this mutable indexed sequence that satisfy the given
predicate p
. The order of the elements is preserved.
Selects all elements of this mutable indexed sequence which satisfy a predicate.
Selects all elements of this mutable indexed sequence which satisfy a predicate.
the predicate used to test elements.
a new mutable indexed sequence consisting of all elements of this mutable indexed sequence that satisfy the given
predicate p
. The order of the elements is preserved.
Selects all elements of this mutable indexed sequence which satisfy a predicate.
Selects all elements of this mutable indexed sequence which satisfy a predicate.
the predicate used to test elements.
a new mutable indexed sequence consisting of all elements of this mutable indexed sequence that satisfy the given
predicate p
. The order of the elements is preserved.
Selects all elements of this mutable indexed sequence which satisfy a predicate.
Selects all elements of this mutable indexed sequence which satisfy a predicate.
the predicate used to test elements.
a new mutable indexed sequence consisting of all elements of this mutable indexed sequence that satisfy the given
predicate p
. The order of the elements is preserved.
Selects all elements of this mutable indexed sequence which do not satisfy a predicate.
Selects all elements of this mutable indexed sequence which do not satisfy a predicate.
the predicate used to test elements.
a new mutable indexed sequence consisting of all elements of this mutable indexed sequence that do not satisfy the given
predicate p
. The order of the elements is preserved.
Selects all elements of this mutable indexed sequence which do not satisfy a predicate.
Selects all elements of this mutable indexed sequence which do not satisfy a predicate.
the predicate used to test elements.
a new mutable indexed sequence consisting of all elements of this mutable indexed sequence that do not satisfy the given
predicate p
. The order of the elements is preserved.
Selects all elements of this mutable indexed sequence which do not satisfy a predicate.
Selects all elements of this mutable indexed sequence which do not satisfy a predicate.
the predicate used to test elements.
a new mutable indexed sequence consisting of all elements of this mutable indexed sequence that do not satisfy the given
predicate p
. The order of the elements is preserved.
Selects all elements of this mutable indexed sequence which do not satisfy a predicate.
Selects all elements of this mutable indexed sequence which do not satisfy a predicate.
the predicate used to test elements.
a new mutable indexed sequence consisting of all elements of this mutable indexed sequence that do not satisfy the given
predicate p
. The order of the elements is preserved.
Selects all elements of this mutable indexed sequence which do not satisfy a predicate.
Selects all elements of this mutable indexed sequence which do not satisfy a predicate.
the predicate used to test elements.
a new mutable indexed sequence consisting of all elements of this mutable indexed sequence that do not satisfy the given
predicate p
. The order of the elements is preserved.
Selects all elements of this mutable indexed sequence which do not satisfy a predicate.
Selects all elements of this mutable indexed sequence which do not satisfy a predicate.
the predicate used to test elements.
a new mutable indexed sequence consisting of all elements of this mutable indexed sequence that do not satisfy the given
predicate p
. The order of the elements is preserved.
Selects all elements of this mutable indexed sequence which do not satisfy a predicate.
Selects all elements of this mutable indexed sequence which do not satisfy a predicate.
the predicate used to test elements.
a new mutable indexed sequence consisting of all elements of this mutable indexed sequence that do not satisfy the given
predicate p
. The order of the elements is preserved.
Selects all elements of this mutable indexed sequence which do not satisfy a predicate.
Selects all elements of this mutable indexed sequence which do not satisfy a predicate.
the predicate used to test elements.
a new mutable indexed sequence consisting of all elements of this mutable indexed sequence that do not satisfy the given
predicate p
. The order of the elements is preserved.
Selects all elements of this mutable indexed sequence which do not satisfy a predicate.
Selects all elements of this mutable indexed sequence which do not satisfy a predicate.
the predicate used to test elements.
a new mutable indexed sequence consisting of all elements of this mutable indexed sequence that do not satisfy the given
predicate p
. The order of the elements is preserved.
Called by the garbage collector on the receiver object when there are no more references to the object.
Called by the garbage collector on the receiver object when there are no more references to the object.
The details of when and if the finalize
method is invoked, as
well as the interaction between finalize
and non-local returns
and exceptions, are all platform dependent.
Finds the first element of the mutable indexed sequence satisfying a predicate, if any.
Finds the first element of the mutable indexed sequence satisfying a predicate, if any.
the predicate used to test elements.
an option value containing the first element in the mutable indexed sequence
that satisfies p
, or None
if none exists.
Finds the first element of the mutable indexed sequence satisfying a predicate, if any.
Finds the first element of the mutable indexed sequence satisfying a predicate, if any.
the predicate used to test elements.
an option value containing the first element in the mutable indexed sequence
that satisfies p
, or None
if none exists.
Finds the first element of the mutable indexed sequence satisfying a predicate, if any.
Finds the first element of the mutable indexed sequence satisfying a predicate, if any.
the predicate used to test elements.
an option value containing the first element in the mutable indexed sequence
that satisfies p
, or None
if none exists.
Finds the first element of the mutable indexed sequence satisfying a predicate, if any.
Finds the first element of the mutable indexed sequence satisfying a predicate, if any.
the predicate used to test elements.
an option value containing the first element in the mutable indexed sequence
that satisfies p
, or None
if none exists.
Finds the first element of the mutable indexed sequence satisfying a predicate, if any.
Finds the first element of the mutable indexed sequence satisfying a predicate, if any.
the predicate used to test elements.
an option value containing the first element in the mutable indexed sequence
that satisfies p
, or None
if none exists.
Finds the first element of the mutable indexed sequence satisfying a predicate, if any.
Finds the first element of the mutable indexed sequence satisfying a predicate, if any.
the predicate used to test elements.
an option value containing the first element in the mutable indexed sequence
that satisfies p
, or None
if none exists.
Finds the first element of the mutable indexed sequence satisfying a predicate, if any.
Finds the first element of the mutable indexed sequence satisfying a predicate, if any.
the predicate used to test elements.
an option value containing the first element in the mutable indexed sequence
that satisfies p
, or None
if none exists.
Finds the first element of the mutable indexed sequence satisfying a predicate, if any.
Finds the first element of the mutable indexed sequence satisfying a predicate, if any.
the predicate used to test elements.
an option value containing the first element in the mutable indexed sequence
that satisfies p
, or None
if none exists.
Finds the first element of the mutable indexed sequence satisfying a predicate, if any.
Finds the first element of the mutable indexed sequence satisfying a predicate, if any.
the predicate used to test elements.
an option value containing the first element in the mutable indexed sequence
that satisfies p
, or None
if none exists.
[use case] Builds a new collection by applying a function to all elements of this array and using the elements of the resulting collections.
Builds a new collection by applying a function to all elements of this array and using the elements of the resulting collections.
For example:
def getWords(lines: Seq[String]): Seq[String] = lines flatMap (line => line split "\\W+")
The type of the resulting collection is guided by the static type of array. This might cause unexpected results sometimes. For example:
// lettersOf will return a Seq[Char] of likely repeated letters, instead of a Set def lettersOf(words: Seq[String]) = words flatMap (word => word.toSet) // lettersOf will return a Set[Char], not a Seq def lettersOf(words: Seq[String]) = words.toSet flatMap (word => word.toSeq) // xs will be an Iterable[Int] val xs = Map("a" -> List(11,111), "b" -> List(22,222)).flatMap(_._2) // ys will be a Map[Int, Int] val ys = Map("a" -> List(1 -> 11,1 -> 111), "b" -> List(2 -> 22,2 -> 222)).flatMap(_._2)
the element type of the returned collection.
the function to apply to each element.
a new array resulting from applying the given collection-valued function
f
to each element of this array and concatenating the results.
[use case] Builds a new collection by applying a function to all elements of this array and using the elements of the resulting collections.
Builds a new collection by applying a function to all elements of this array and using the elements of the resulting collections.
For example:
def getWords(lines: Seq[String]): Seq[String] = lines flatMap (line => line split "\\W+")
The type of the resulting collection is guided by the static type of array. This might cause unexpected results sometimes. For example:
// lettersOf will return a Seq[Char] of likely repeated letters, instead of a Set def lettersOf(words: Seq[String]) = words flatMap (word => word.toSet) // lettersOf will return a Set[Char], not a Seq def lettersOf(words: Seq[String]) = words.toSet flatMap (word => word.toSeq) // xs will be an Iterable[Int] val xs = Map("a" -> List(11,111), "b" -> List(22,222)).flatMap(_._2) // ys will be a Map[Int, Int] val ys = Map("a" -> List(1 -> 11,1 -> 111), "b" -> List(2 -> 22,2 -> 222)).flatMap(_._2)
the element type of the returned collection.
the function to apply to each element.
a new array resulting from applying the given collection-valued function
f
to each element of this array and concatenating the results.
[use case] Builds a new collection by applying a function to all elements of this array and using the elements of the resulting collections.
Builds a new collection by applying a function to all elements of this array and using the elements of the resulting collections.
For example:
def getWords(lines: Seq[String]): Seq[String] = lines flatMap (line => line split "\\W+")
The type of the resulting collection is guided by the static type of array. This might cause unexpected results sometimes. For example:
// lettersOf will return a Seq[Char] of likely repeated letters, instead of a Set def lettersOf(words: Seq[String]) = words flatMap (word => word.toSet) // lettersOf will return a Set[Char], not a Seq def lettersOf(words: Seq[String]) = words.toSet flatMap (word => word.toSeq) // xs will be an Iterable[Int] val xs = Map("a" -> List(11,111), "b" -> List(22,222)).flatMap(_._2) // ys will be a Map[Int, Int] val ys = Map("a" -> List(1 -> 11,1 -> 111), "b" -> List(2 -> 22,2 -> 222)).flatMap(_._2)
the element type of the returned collection.
the function to apply to each element.
a new array resulting from applying the given collection-valued function
f
to each element of this array and concatenating the results.
[use case] Builds a new collection by applying a function to all elements of this array and using the elements of the resulting collections.
Builds a new collection by applying a function to all elements of this array and using the elements of the resulting collections.
For example:
def getWords(lines: Seq[String]): Seq[String] = lines flatMap (line => line split "\\W+")
The type of the resulting collection is guided by the static type of array. This might cause unexpected results sometimes. For example:
// lettersOf will return a Seq[Char] of likely repeated letters, instead of a Set def lettersOf(words: Seq[String]) = words flatMap (word => word.toSet) // lettersOf will return a Set[Char], not a Seq def lettersOf(words: Seq[String]) = words.toSet flatMap (word => word.toSeq) // xs will be an Iterable[Int] val xs = Map("a" -> List(11,111), "b" -> List(22,222)).flatMap(_._2) // ys will be a Map[Int, Int] val ys = Map("a" -> List(1 -> 11,1 -> 111), "b" -> List(2 -> 22,2 -> 222)).flatMap(_._2)
the element type of the returned collection.
the function to apply to each element.
a new array resulting from applying the given collection-valued function
f
to each element of this array and concatenating the results.
[use case] Builds a new collection by applying a function to all elements of this array and using the elements of the resulting collections.
Builds a new collection by applying a function to all elements of this array and using the elements of the resulting collections.
For example:
def getWords(lines: Seq[String]): Seq[String] = lines flatMap (line => line split "\\W+")
The type of the resulting collection is guided by the static type of array. This might cause unexpected results sometimes. For example:
// lettersOf will return a Seq[Char] of likely repeated letters, instead of a Set def lettersOf(words: Seq[String]) = words flatMap (word => word.toSet) // lettersOf will return a Set[Char], not a Seq def lettersOf(words: Seq[String]) = words.toSet flatMap (word => word.toSeq) // xs will be an Iterable[Int] val xs = Map("a" -> List(11,111), "b" -> List(22,222)).flatMap(_._2) // ys will be a Map[Int, Int] val ys = Map("a" -> List(1 -> 11,1 -> 111), "b" -> List(2 -> 22,2 -> 222)).flatMap(_._2)
the element type of the returned collection.
the function to apply to each element.
a new array resulting from applying the given collection-valued function
f
to each element of this array and concatenating the results.
[use case] Builds a new collection by applying a function to all elements of this array and using the elements of the resulting collections.
Builds a new collection by applying a function to all elements of this array and using the elements of the resulting collections.
For example:
def getWords(lines: Seq[String]): Seq[String] = lines flatMap (line => line split "\\W+")
The type of the resulting collection is guided by the static type of array. This might cause unexpected results sometimes. For example:
// lettersOf will return a Seq[Char] of likely repeated letters, instead of a Set def lettersOf(words: Seq[String]) = words flatMap (word => word.toSet) // lettersOf will return a Set[Char], not a Seq def lettersOf(words: Seq[String]) = words.toSet flatMap (word => word.toSeq) // xs will be an Iterable[Int] val xs = Map("a" -> List(11,111), "b" -> List(22,222)).flatMap(_._2) // ys will be a Map[Int, Int] val ys = Map("a" -> List(1 -> 11,1 -> 111), "b" -> List(2 -> 22,2 -> 222)).flatMap(_._2)
the element type of the returned collection.
the function to apply to each element.
a new array resulting from applying the given collection-valued function
f
to each element of this array and concatenating the results.
[use case] Builds a new collection by applying a function to all elements of this array and using the elements of the resulting collections.
Builds a new collection by applying a function to all elements of this array and using the elements of the resulting collections.
For example:
def getWords(lines: Seq[String]): Seq[String] = lines flatMap (line => line split "\\W+")
The type of the resulting collection is guided by the static type of array. This might cause unexpected results sometimes. For example:
// lettersOf will return a Seq[Char] of likely repeated letters, instead of a Set def lettersOf(words: Seq[String]) = words flatMap (word => word.toSet) // lettersOf will return a Set[Char], not a Seq def lettersOf(words: Seq[String]) = words.toSet flatMap (word => word.toSeq) // xs will be an Iterable[Int] val xs = Map("a" -> List(11,111), "b" -> List(22,222)).flatMap(_._2) // ys will be a Map[Int, Int] val ys = Map("a" -> List(1 -> 11,1 -> 111), "b" -> List(2 -> 22,2 -> 222)).flatMap(_._2)
the element type of the returned collection.
the function to apply to each element.
a new array resulting from applying the given collection-valued function
f
to each element of this array and concatenating the results.
[use case] Builds a new collection by applying a function to all elements of this array and using the elements of the resulting collections.
Builds a new collection by applying a function to all elements of this array and using the elements of the resulting collections.
For example:
def getWords(lines: Seq[String]): Seq[String] = lines flatMap (line => line split "\\W+")
The type of the resulting collection is guided by the static type of array. This might cause unexpected results sometimes. For example:
// lettersOf will return a Seq[Char] of likely repeated letters, instead of a Set def lettersOf(words: Seq[String]) = words flatMap (word => word.toSet) // lettersOf will return a Set[Char], not a Seq def lettersOf(words: Seq[String]) = words.toSet flatMap (word => word.toSeq) // xs will be an Iterable[Int] val xs = Map("a" -> List(11,111), "b" -> List(22,222)).flatMap(_._2) // ys will be a Map[Int, Int] val ys = Map("a" -> List(1 -> 11,1 -> 111), "b" -> List(2 -> 22,2 -> 222)).flatMap(_._2)
the element type of the returned collection.
the function to apply to each element.
a new array resulting from applying the given collection-valued function
f
to each element of this array and concatenating the results.
[use case] Builds a new collection by applying a function to all elements of this array and using the elements of the resulting collections.
Builds a new collection by applying a function to all elements of this array and using the elements of the resulting collections.
For example:
def getWords(lines: Seq[String]): Seq[String] = lines flatMap (line => line split "\\W+")
The type of the resulting collection is guided by the static type of array. This might cause unexpected results sometimes. For example:
// lettersOf will return a Seq[Char] of likely repeated letters, instead of a Set def lettersOf(words: Seq[String]) = words flatMap (word => word.toSet) // lettersOf will return a Set[Char], not a Seq def lettersOf(words: Seq[String]) = words.toSet flatMap (word => word.toSeq) // xs will be an Iterable[Int] val xs = Map("a" -> List(11,111), "b" -> List(22,222)).flatMap(_._2) // ys will be a Map[Int, Int] val ys = Map("a" -> List(1 -> 11,1 -> 111), "b" -> List(2 -> 22,2 -> 222)).flatMap(_._2)
the element type of the returned collection.
the function to apply to each element.
a new array resulting from applying the given collection-valued function
f
to each element of this array and concatenating the results.
[use case] Builds a new collection by applying a function to all elements of this array and using the elements of the resulting collections.
Builds a new collection by applying a function to all elements of this array and using the elements of the resulting collections.
For example:
def getWords(lines: Seq[String]): Seq[String] = lines flatMap (line => line split "\\W+")
The type of the resulting collection is guided by the static type of array. This might cause unexpected results sometimes. For example:
// lettersOf will return a Seq[Char] of likely repeated letters, instead of a Set def lettersOf(words: Seq[String]) = words flatMap (word => word.toSet) // lettersOf will return a Set[Char], not a Seq def lettersOf(words: Seq[String]) = words.toSet flatMap (word => word.toSeq) // xs will be an Iterable[Int] val xs = Map("a" -> List(11,111), "b" -> List(22,222)).flatMap(_._2) // ys will be a Map[Int, Int] val ys = Map("a" -> List(1 -> 11,1 -> 111), "b" -> List(2 -> 22,2 -> 222)).flatMap(_._2)
the element type of the returned collection.
the function to apply to each element.
a new array resulting from applying the given collection-valued function
f
to each element of this array and concatenating the results.
[use case] Builds a new collection by applying a function to all elements of this array and using the elements of the resulting collections.
Builds a new collection by applying a function to all elements of this array and using the elements of the resulting collections.
For example:
def getWords(lines: Seq[String]): Seq[String] = lines flatMap (line => line split "\\W+")
The type of the resulting collection is guided by the static type of array. This might cause unexpected results sometimes. For example:
// lettersOf will return a Seq[Char] of likely repeated letters, instead of a Set def lettersOf(words: Seq[String]) = words flatMap (word => word.toSet) // lettersOf will return a Set[Char], not a Seq def lettersOf(words: Seq[String]) = words.toSet flatMap (word => word.toSeq) // xs will be an Iterable[Int] val xs = Map("a" -> List(11,111), "b" -> List(22,222)).flatMap(_._2) // ys will be a Map[Int, Int] val ys = Map("a" -> List(1 -> 11,1 -> 111), "b" -> List(2 -> 22,2 -> 222)).flatMap(_._2)
the element type of the returned collection.
the function to apply to each element.
a new array resulting from applying the given collection-valued function
f
to each element of this array and concatenating the results.
Flattens a two-dimensional array by concatenating all its rows into a single array.
Flattens a two-dimensional array by concatenating all its rows into a single array.
Type of row elements.
A function that converts elements of this array to rows - arrays of type U
.
An array obtained by concatenating rows of this array.
Flattens a two-dimensional array by concatenating all its rows into a single array.
Flattens a two-dimensional array by concatenating all its rows into a single array.
Type of row elements.
A function that converts elements of this array to rows - arrays of type U
.
An array obtained by concatenating rows of this array.
Flattens a two-dimensional array by concatenating all its rows into a single array.
Flattens a two-dimensional array by concatenating all its rows into a single array.
Type of row elements.
A function that converts elements of this array to rows - arrays of type U
.
An array obtained by concatenating rows of this array.
Flattens a two-dimensional array by concatenating all its rows into a single array.
Flattens a two-dimensional array by concatenating all its rows into a single array.
Type of row elements.
A function that converts elements of this array to rows - arrays of type U
.
An array obtained by concatenating rows of this array.
Flattens a two-dimensional array by concatenating all its rows into a single array.
Flattens a two-dimensional array by concatenating all its rows into a single array.
Type of row elements.
A function that converts elements of this array to rows - arrays of type U
.
An array obtained by concatenating rows of this array.
Flattens a two-dimensional array by concatenating all its rows into a single array.
Flattens a two-dimensional array by concatenating all its rows into a single array.
Type of row elements.
A function that converts elements of this array to rows - arrays of type U
.
An array obtained by concatenating rows of this array.
Flattens a two-dimensional array by concatenating all its rows into a single array.
Flattens a two-dimensional array by concatenating all its rows into a single array.
Type of row elements.
A function that converts elements of this array to rows - arrays of type U
.
An array obtained by concatenating rows of this array.
Flattens a two-dimensional array by concatenating all its rows into a single array.
Flattens a two-dimensional array by concatenating all its rows into a single array.
Type of row elements.
A function that converts elements of this array to rows - arrays of type U
.
An array obtained by concatenating rows of this array.
Flattens a two-dimensional array by concatenating all its rows into a single array.
Flattens a two-dimensional array by concatenating all its rows into a single array.
Type of row elements.
A function that converts elements of this array to rows - arrays of type U
.
An array obtained by concatenating rows of this array.
Folds the elements of this mutable indexed sequence using the specified associative binary operator.
Folds the elements of this mutable indexed sequence using the specified associative binary operator.
The order in which operations are performed on elements is unspecified and may be nondeterministic.
a type parameter for the binary operator, a supertype of A
.
a neutral element for the fold operation; may be added to the result
an arbitrary number of times, and must not change the result (e.g., Nil
for list concatenation,
0 for addition, or 1 for multiplication.)
a binary operator that must be associative
the result of applying fold operator op
between all the elements and z
Folds the elements of this mutable indexed sequence using the specified associative binary operator.
Folds the elements of this mutable indexed sequence using the specified associative binary operator.
The order in which operations are performed on elements is unspecified and may be nondeterministic.
a type parameter for the binary operator, a supertype of A
.
a neutral element for the fold operation; may be added to the result
an arbitrary number of times, and must not change the result (e.g., Nil
for list concatenation,
0 for addition, or 1 for multiplication.)
a binary operator that must be associative
the result of applying fold operator op
between all the elements and z
Folds the elements of this mutable indexed sequence using the specified associative binary operator.
Folds the elements of this mutable indexed sequence using the specified associative binary operator.
The order in which operations are performed on elements is unspecified and may be nondeterministic.
a type parameter for the binary operator, a supertype of A
.
a neutral element for the fold operation; may be added to the result
an arbitrary number of times, and must not change the result (e.g., Nil
for list concatenation,
0 for addition, or 1 for multiplication.)
a binary operator that must be associative
the result of applying fold operator op
between all the elements and z
Folds the elements of this mutable indexed sequence using the specified associative binary operator.
Folds the elements of this mutable indexed sequence using the specified associative binary operator.
The order in which operations are performed on elements is unspecified and may be nondeterministic.
a type parameter for the binary operator, a supertype of A
.
a neutral element for the fold operation; may be added to the result
an arbitrary number of times, and must not change the result (e.g., Nil
for list concatenation,
0 for addition, or 1 for multiplication.)
a binary operator that must be associative
the result of applying fold operator op
between all the elements and z
Folds the elements of this mutable indexed sequence using the specified associative binary operator.
Folds the elements of this mutable indexed sequence using the specified associative binary operator.
The order in which operations are performed on elements is unspecified and may be nondeterministic.
a type parameter for the binary operator, a supertype of A
.
a neutral element for the fold operation; may be added to the result
an arbitrary number of times, and must not change the result (e.g., Nil
for list concatenation,
0 for addition, or 1 for multiplication.)
a binary operator that must be associative
the result of applying fold operator op
between all the elements and z
Folds the elements of this mutable indexed sequence using the specified associative binary operator.
Folds the elements of this mutable indexed sequence using the specified associative binary operator.
The order in which operations are performed on elements is unspecified and may be nondeterministic.
a type parameter for the binary operator, a supertype of A
.
a neutral element for the fold operation; may be added to the result
an arbitrary number of times, and must not change the result (e.g., Nil
for list concatenation,
0 for addition, or 1 for multiplication.)
a binary operator that must be associative
the result of applying fold operator op
between all the elements and z
Folds the elements of this mutable indexed sequence using the specified associative binary operator.
Folds the elements of this mutable indexed sequence using the specified associative binary operator.
The order in which operations are performed on elements is unspecified and may be nondeterministic.
a type parameter for the binary operator, a supertype of A
.
a neutral element for the fold operation; may be added to the result
an arbitrary number of times, and must not change the result (e.g., Nil
for list concatenation,
0 for addition, or 1 for multiplication.)
a binary operator that must be associative
the result of applying fold operator op
between all the elements and z
Folds the elements of this mutable indexed sequence using the specified associative binary operator.
Folds the elements of this mutable indexed sequence using the specified associative binary operator.
The order in which operations are performed on elements is unspecified and may be nondeterministic.
a type parameter for the binary operator, a supertype of A
.
a neutral element for the fold operation; may be added to the result
an arbitrary number of times, and must not change the result (e.g., Nil
for list concatenation,
0 for addition, or 1 for multiplication.)
a binary operator that must be associative
the result of applying fold operator op
between all the elements and z
Folds the elements of this mutable indexed sequence using the specified associative binary operator.
Folds the elements of this mutable indexed sequence using the specified associative binary operator.
The order in which operations are performed on elements is unspecified and may be nondeterministic.
a type parameter for the binary operator, a supertype of A
.
a neutral element for the fold operation; may be added to the result
an arbitrary number of times, and must not change the result (e.g., Nil
for list concatenation,
0 for addition, or 1 for multiplication.)
a binary operator that must be associative
the result of applying fold operator op
between all the elements and z
Folds the elements of this mutable indexed sequence using the specified associative binary operator.
Folds the elements of this mutable indexed sequence using the specified associative binary operator.
The order in which operations are performed on elements is unspecified and may be nondeterministic.
a type parameter for the binary operator, a supertype of A
.
a neutral element for the fold operation; may be added to the result
an arbitrary number of times, and must not change the result (e.g., Nil
for list concatenation,
0 for addition, or 1 for multiplication.)
a binary operator that must be associative
the result of applying fold operator op
between all the elements and z
Folds the elements of this mutable indexed sequence using the specified associative binary operator.
Folds the elements of this mutable indexed sequence using the specified associative binary operator.
The order in which operations are performed on elements is unspecified and may be nondeterministic.
a type parameter for the binary operator, a supertype of A
.
a neutral element for the fold operation; may be added to the result
an arbitrary number of times, and must not change the result (e.g., Nil
for list concatenation,
0 for addition, or 1 for multiplication.)
a binary operator that must be associative
the result of applying fold operator op
between all the elements and z
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
the result type of the binary operator.
the start value.
the binary operator.
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going left to right with the start value z
on the left:
op(...op(z, x_1), x_2, ..., x_n)
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
the result type of the binary operator.
the start value.
the binary operator.
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going left to right with the start value z
on the left:
op(...op(z, x_1), x_2, ..., x_n)
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
the result type of the binary operator.
the start value.
the binary operator.
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going left to right with the start value z
on the left:
op(...op(z, x_1), x_2, ..., x_n)
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
the result type of the binary operator.
the start value.
the binary operator.
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going left to right with the start value z
on the left:
op(...op(z, x_1), x_2, ..., x_n)
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
the result type of the binary operator.
the start value.
the binary operator.
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going left to right with the start value z
on the left:
op(...op(z, x_1), x_2, ..., x_n)
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
the result type of the binary operator.
the start value.
the binary operator.
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going left to right with the start value z
on the left:
op(...op(z, x_1), x_2, ..., x_n)
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
the result type of the binary operator.
the start value.
the binary operator.
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going left to right with the start value z
on the left:
op(...op(z, x_1), x_2, ..., x_n)
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
the result type of the binary operator.
the start value.
the binary operator.
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going left to right with the start value z
on the left:
op(...op(z, x_1), x_2, ..., x_n)
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
Applies a binary operator to a start value and all elements of this mutable indexed sequence, going left to right.
the result type of the binary operator.
the start value.
the binary operator.
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going left to right with the start value z
on the left:
op(...op(z, x_1), x_2, ..., x_n)
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
the result type of the binary operator.
the start value.
the binary operator.
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going right to left with the start value z
on the right:
op(x_1, op(x_2, ... op(x_n, z)...))
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
the result type of the binary operator.
the start value.
the binary operator.
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going right to left with the start value z
on the right:
op(x_1, op(x_2, ... op(x_n, z)...))
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
the result type of the binary operator.
the start value.
the binary operator.
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going right to left with the start value z
on the right:
op(x_1, op(x_2, ... op(x_n, z)...))
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
the result type of the binary operator.
the start value.
the binary operator.
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going right to left with the start value z
on the right:
op(x_1, op(x_2, ... op(x_n, z)...))
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
the result type of the binary operator.
the start value.
the binary operator.
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going right to left with the start value z
on the right:
op(x_1, op(x_2, ... op(x_n, z)...))
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
the result type of the binary operator.
the start value.
the binary operator.
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going right to left with the start value z
on the right:
op(x_1, op(x_2, ... op(x_n, z)...))
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
the result type of the binary operator.
the start value.
the binary operator.
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going right to left with the start value z
on the right:
op(x_1, op(x_2, ... op(x_n, z)...))
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
the result type of the binary operator.
the start value.
the binary operator.
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going right to left with the start value z
on the right:
op(x_1, op(x_2, ... op(x_n, z)...))
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
Applies a binary operator to all elements of this mutable indexed sequence and a start value, going right to left.
the result type of the binary operator.
the start value.
the binary operator.
the result of inserting op
between consecutive elements of this mutable indexed sequence,
going right to left with the start value z
on the right:
op(x_1, op(x_2, ... op(x_n, z)...))
where x_{1}, ..., x_{n}
are the elements of this mutable indexed sequence.
Tests whether a predicate holds for all elements of this mutable indexed sequence.
Tests whether a predicate holds for all elements of this mutable indexed sequence.
the predicate used to test elements.
true
if this mutable indexed sequence is empty, otherwise true
if the given predicate p
holds for all elements of this mutable indexed sequence, otherwise false
.
Tests whether a predicate holds for all elements of this mutable indexed sequence.
Tests whether a predicate holds for all elements of this mutable indexed sequence.
the predicate used to test elements.
true
if this mutable indexed sequence is empty, otherwise true
if the given predicate p
holds for all elements of this mutable indexed sequence, otherwise false
.
Tests whether a predicate holds for all elements of this mutable indexed sequence.
Tests whether a predicate holds for all elements of this mutable indexed sequence.
the predicate used to test elements.
true
if this mutable indexed sequence is empty, otherwise true
if the given predicate p
holds for all elements of this mutable indexed sequence, otherwise false
.
Tests whether a predicate holds for all elements of this mutable indexed sequence.
Tests whether a predicate holds for all elements of this mutable indexed sequence.
the predicate used to test elements.
true
if this mutable indexed sequence is empty, otherwise true
if the given predicate p
holds for all elements of this mutable indexed sequence, otherwise false
.
Tests whether a predicate holds for all elements of this mutable indexed sequence.
Tests whether a predicate holds for all elements of this mutable indexed sequence.
the predicate used to test elements.
true
if this mutable indexed sequence is empty, otherwise true
if the given predicate p
holds for all elements of this mutable indexed sequence, otherwise false
.
Tests whether a predicate holds for all elements of this mutable indexed sequence.
Tests whether a predicate holds for all elements of this mutable indexed sequence.
the predicate used to test elements.
true
if this mutable indexed sequence is empty, otherwise true
if the given predicate p
holds for all elements of this mutable indexed sequence, otherwise false
.
Tests whether a predicate holds for all elements of this mutable indexed sequence.
Tests whether a predicate holds for all elements of this mutable indexed sequence.
the predicate used to test elements.
true
if this mutable indexed sequence is empty, otherwise true
if the given predicate p
holds for all elements of this mutable indexed sequence, otherwise false
.
Tests whether a predicate holds for all elements of this mutable indexed sequence.
Tests whether a predicate holds for all elements of this mutable indexed sequence.
the predicate used to test elements.
true
if this mutable indexed sequence is empty, otherwise true
if the given predicate p
holds for all elements of this mutable indexed sequence, otherwise false
.
Tests whether a predicate holds for all elements of this mutable indexed sequence.
Tests whether a predicate holds for all elements of this mutable indexed sequence.
the predicate used to test elements.
true
if this mutable indexed sequence is empty, otherwise true
if the given predicate p
holds for all elements of this mutable indexed sequence, otherwise false
.
Returns string formatted according to given format
string.
Returns string formatted according to given format
string.
Format strings are as for String.format
(@see java.lang.String.format).
Returns the runtime class representation of the object.
Returns the runtime class representation of the object.
a class object corresponding to the runtime type of the receiver.
Partitions this mutable indexed sequence into a map of mutable indexed sequences according to some discriminator function.
Partitions this mutable indexed sequence into a map of mutable indexed sequences according to some discriminator function.
Note: this method is not re-implemented by views. This means when applied to a view it will always force the view and return a new mutable indexed sequence.
the type of keys returned by the discriminator function.
the discriminator function.
A map from keys to mutable indexed sequences such that the following invariant holds:
(xs groupBy f)(k) = xs filter (x => f(x) == k)
That is, every key k
is bound to a mutable indexed sequence of those elements x
for which f(x)
equals k
.
Partitions this mutable indexed sequence into a map of mutable indexed sequences according to some discriminator function.
Partitions this mutable indexed sequence into a map of mutable indexed sequences according to some discriminator function.
Note: this method is not re-implemented by views. This means when applied to a view it will always force the view and return a new mutable indexed sequence.
the type of keys returned by the discriminator function.
the discriminator function.
A map from keys to mutable indexed sequences such that the following invariant holds:
(xs groupBy f)(k) = xs filter (x => f(x) == k)
That is, every key k
is bound to a mutable indexed sequence of those elements x
for which f(x)
equals k
.
Partitions this mutable indexed sequence into a map of mutable indexed sequences according to some discriminator function.
Partitions this mutable indexed sequence into a map of mutable indexed sequences according to some discriminator function.
Note: this method is not re-implemented by views. This means when applied to a view it will always force the view and return a new mutable indexed sequence.
the type of keys returned by the discriminator function.
the discriminator function.
A map from keys to mutable indexed sequences such that the following invariant holds:
(xs groupBy f)(k) = xs filter (x => f(x) == k)
That is, every key k
is bound to a mutable indexed sequence of those elements x
for which f(x)
equals k
.
Partitions this mutable indexed sequence into a map of mutable indexed sequences according to some discriminator function.
Partitions this mutable indexed sequence into a map of mutable indexed sequences according to some discriminator function.
Note: this method is not re-implemented by views. This means when applied to a view it will always force the view and return a new mutable indexed sequence.
the type of keys returned by the discriminator function.
the discriminator function.
A map from keys to mutable indexed sequences such that the following invariant holds:
(xs groupBy f)(k) = xs filter (x => f(x) == k)
That is, every key k
is bound to a mutable indexed sequence of those elements x
for which f(x)
equals k
.
Partitions this mutable indexed sequence into a map of mutable indexed sequences according to some discriminator function.
Partitions this mutable indexed sequence into a map of mutable indexed sequences according to some discriminator function.
Note: this method is not re-implemented by views. This means when applied to a view it will always force the view and return a new mutable indexed sequence.
the type of keys returned by the discriminator function.
the discriminator function.
A map from keys to mutable indexed sequences such that the following invariant holds:
(xs groupBy f)(k) = xs filter (x => f(x) == k)
That is, every key k
is bound to a mutable indexed sequence of those elements x
for which f(x)
equals k
.
Partitions this mutable indexed sequence into a map of mutable indexed sequences according to some discriminator function.
Partitions this mutable indexed sequence into a map of mutable indexed sequences according to some discriminator function.
Note: this method is not re-implemented by views. This means when applied to a view it will always force the view and return a new mutable indexed sequence.
the type of keys returned by the discriminator function.
the discriminator function.
A map from keys to mutable indexed sequences such that the following invariant holds:
(xs groupBy f)(k) = xs filter (x => f(x) == k)
That is, every key k
is bound to a mutable indexed sequence of those elements x
for which f(x)
equals k
.
Partitions this mutable indexed sequence into a map of mutable indexed sequences according to some discriminator function.
Partitions this mutable indexed sequence into a map of mutable indexed sequences according to some discriminator function.
Note: this method is not re-implemented by views. This means when applied to a view it will always force the view and return a new mutable indexed sequence.
the type of keys returned by the discriminator function.
the discriminator function.
A map from keys to mutable indexed sequences such that the following invariant holds:
(xs groupBy f)(k) = xs filter (x => f(x) == k)
That is, every key k
is bound to a mutable indexed sequence of those elements x
for which f(x)
equals k
.
Partitions this mutable indexed sequence into a map of mutable indexed sequences according to some discriminator function.
Partitions this mutable indexed sequence into a map of mutable indexed sequences according to some discriminator function.
Note: this method is not re-implemented by views. This means when applied to a view it will always force the view and return a new mutable indexed sequence.
the type of keys returned by the discriminator function.
the discriminator function.
A map from keys to mutable indexed sequences such that the following invariant holds:
(xs groupBy f)(k) = xs filter (x => f(x) == k)
That is, every key k
is bound to a mutable indexed sequence of those elements x
for which f(x)
equals k
.
Partitions this mutable indexed sequence into a map of mutable indexed sequences according to some discriminator function.
Partitions this mutable indexed sequence into a map of mutable indexed sequences according to some discriminator function.
Note: this method is not re-implemented by views. This means when applied to a view it will always force the view and return a new mutable indexed sequence.
the type of keys returned by the discriminator function.
the discriminator function.
A map from keys to mutable indexed sequences such that the following invariant holds:
(xs groupBy f)(k) = xs filter (x => f(x) == k)
That is, every key k
is bound to a mutable indexed sequence of those elements x
for which f(x)
equals k
.
The hashCode method for reference types.
[use case] Finds index of first occurrence of some value in this array after or at some start index.
Finds index of first occurrence of some value in this array after or at some start index.
the element value to search for.
the start index
the index >= from
of the first element of this array that is equal (as determined by ==
)
to elem
, or -1
, if none exists.
[use case] Finds index of first occurrence of some value in this array.
Finds index of first occurrence of some value in this array.
the element value to search for.
the index of the first element of this array that is equal (as determined by ==
)
to elem
, or -1
, if none exists.
[use case] Finds index of first occurrence of some value in this array after or at some start index.
Finds index of first occurrence of some value in this array after or at some start index.
the element value to search for.
the start index
the index >= from
of the first element of this array that is equal (as determined by ==
)
to elem
, or -1
, if none exists.
[use case] Finds index of first occurrence of some value in this array.
Finds index of first occurrence of some value in this array.
the element value to search for.
the index of the first element of this array that is equal (as determined by ==
)
to elem
, or -1
, if none exists.
[use case] Finds index of first occurrence of some value in this array after or at some start index.
Finds index of first occurrence of some value in this array after or at some start index.
the element value to search for.
the start index
the index >= from
of the first element of this array that is equal (as determined by ==
)
to elem
, or -1
, if none exists.
[use case] Finds index of first occurrence of some value in this array.
Finds index of first occurrence of some value in this array.
the element value to search for.
the index of the first element of this array that is equal (as determined by ==
)
to elem
, or -1
, if none exists.
[use case] Finds index of first occurrence of some value in this array after or at some start index.
Finds index of first occurrence of some value in this array after or at some start index.
the element value to search for.
the start index
the index >= from
of the first element of this array that is equal (as determined by ==
)
to elem
, or -1
, if none exists.
[use case] Finds index of first occurrence of some value in this array.
Finds index of first occurrence of some value in this array.
the element value to search for.
the index of the first element of this array that is equal (as determined by ==
)
to elem
, or -1
, if none exists.
[use case] Finds index of first occurrence of some value in this array after or at some start index.
Finds index of first occurrence of some value in this array after or at some start index.
the element value to search for.
the start index
the index >= from
of the first element of this array that is equal (as determined by ==
)
to elem
, or -1
, if none exists.
[use case] Finds index of first occurrence of some value in this array.
Finds index of first occurrence of some value in this array.
the element value to search for.
the index of the first element of this array that is equal (as determined by ==
)
to elem
, or -1
, if none exists.
[use case] Finds index of first occurrence of some value in this array after or at some start index.
Finds index of first occurrence of some value in this array after or at some start index.
the element value to search for.
the start index
the index >= from
of the first element of this array that is equal (as determined by ==
)
to elem
, or -1
, if none exists.
[use case] Finds index of first occurrence of some value in this array.
Finds index of first occurrence of some value in this array.
the element value to search for.
the index of the first element of this array that is equal (as determined by ==
)
to elem
, or -1
, if none exists.
[use case] Finds index of first occurrence of some value in this array after or at some start index.
Finds index of first occurrence of some value in this array after or at some start index.
the element value to search for.
the start index
the index >= from
of the first element of this array that is equal (as determined by ==
)
to elem
, or -1
, if none exists.
[use case] Finds index of first occurrence of some value in this array.
Finds index of first occurrence of some value in this array.
the element value to search for.
the index of the first element of this array that is equal (as determined by ==
)
to elem
, or -1
, if none exists.
[use case] Finds index of first occurrence of some value in this array after or at some start index.
Finds index of first occurrence of some value in this array after or at some start index.
the element value to search for.
the start index
the index >= from
of the first element of this array that is equal (as determined by ==
)
to elem
, or -1
, if none exists.
[use case] Finds index of first occurrence of some value in this array.
Finds index of first occurrence of some value in this array.
the element value to search for.
the index of the first element of this array that is equal (as determined by ==
)
to elem
, or -1
, if none exists.
[use case] Finds index of first occurrence of some value in this array after or at some start index.
Finds index of first occurrence of some value in this array after or at some start index.
the element value to search for.
the start index
the index >= from
of the first element of this array that is equal (as determined by ==
)
to elem
, or -1
, if none exists.
[use case] Finds index of first occurrence of some value in this array.
Finds index of first occurrence of some value in this array.
the element value to search for.
the index of the first element of this array that is equal (as determined by ==
)
to elem
, or -1
, if none exists.
Arrays are mutable, indexed collections of values.
Array[T]
is Scala's representation for Java'sT[]
.Arrays make use of two common pieces of Scala syntactic sugar, shown on lines 2 and 3 of the above example code. Line 2 is translated into a call to
apply(Int)
, while line 3 is translated into a call toupdate(Int, T)
.Two implicit conversions exist in scala.Predef that are frequently applied to arrays: a conversion to scala.collection.mutable.ArrayOps (shown on line 4 of the example above) and a conversion to scala.collection.mutable.WrappedArray (a subtype of scala.collection.Seq). Both types make available many of the standard operations found in the Scala collections API. The conversion to
ArrayOps
is temporary, as all operations defined onArrayOps
return anArray
, while the conversion toWrappedArray
is permanent as all operations return aWrappedArray
.The conversion to
ArrayOps
takes priority over the conversion toWrappedArray
. For instance, consider the following code:Value
arrReversed
will be of typeArray[Int]
, with an implicit conversion toArrayOps
occurring to perform thereverse
operation. The value ofseqReversed
, on the other hand, will be computed by converting toWrappedArray
first and invoking the variant ofreverse
that returns anotherWrappedArray
.1.0
"The Scala 2.8 Collections' API" section on
Array
by Martin Odersky for more information."Scala 2.8 Arrays" the Scala Improvement Document detailing arrays since Scala 2.8.
Scala Language Specification, for in-depth information on the transformations the Scala compiler makes on Arrays (Sections 6.6 and 6.15 respectively.)