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.

Appends all elements of this map to a string builder using start, end, and separator strings.

Appends all elements of this map to a string builder using start, end, and separator strings.
The written text begins with the string start and ends with the string end.
Inside, the string representations (w.r.t. the method toString)
of all elements of this map are separated by the string sep.

Appends all elements of this collection to a string builder.
The written text consists of the string representations (w.r.t. the method
toString) of all elements of this collection without any separator string.

Appends all elements of this collection to a string builder using a separator string.

Appends all elements of this collection to a string builder using a separator string.
The written text consists of the string representations (w.r.t. the method toString)
of all elements of this collection, separated by the string sep.

Composes this partial function with another partial function that
gets applied to results of this partial function.

Composes this partial function with another partial function that
gets applied to results of this partial function.

Note that calling isDefinedAt on the resulting partial function may apply the first
partial function and execute its side effect. It is highly recommended to call applyOrElse
instead of isDefinedAt / apply for efficiency.

C

the result type of the transformation function.

k

the transformation function

returns

a partial function with the domain of this partial function narrowed by
other partial function, which maps arguments x to k(this(x)).

Retrieves the value which is associated with the given key. This
method invokes the default method of the map if there is no mapping
from the given key to a value. Unless overridden, the default method throws a
NoSuchElementException.

key

the key

returns

the value associated with the given key, or the result of the
map's default method, if none exists.

Applies this partial function to the given argument when it is contained in the function domain.

Applies this partial function to the given argument when it is contained in the function domain.
Applies fallback function where this partial function is not defined.

Note that expression pf.applyOrElse(x, default) is equivalent to

if(pf isDefinedAt x) pf(x) else default(x)

except that applyOrElse method can be implemented more efficiently.
For all partial function literals the compiler generates an applyOrElse implementation which
avoids double evaluation of pattern matchers and guards.
This makes applyOrElse the basis for the efficient implementation for many operations and scenarios, such as:

combining partial functions into orElse/andThen chains does not lead to
excessive apply/isDefinedAt evaluation

lift and unlift do not evaluate source functions twice on each invocation

For non-literal partial function classes with nontrivial isDefinedAt method
it is recommended to override applyOrElse with custom implementation that avoids
double isDefinedAt evaluation. This may result in better performance
and more predictable behavior w.r.t. side effects.

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.

It is recommended to return the name of the concrete collection type, but
not implementation subclasses. For example, for ListMap this method should
return "ListMap", not "Map" (the supertype) or "Node" (an implementation
subclass).

Reuse:
After calling this method, one should discard the iterator it was called
on, and use only the iterator that was returned. Using the old iterator
is undefined, subject to change, and may result in changes to the new
iterator as well.

Composes another partial function k with this partial function so that this
partial function gets applied to results of k.

Composes another partial function k with this partial function so that this
partial function gets applied to results of k.

Note that calling isDefinedAt on the resulting partial function may apply the first
partial function and execute its side effect. It is highly recommended to call applyOrElse
instead of isDefinedAt / apply for efficiency.

R

the parameter type of the transformation function.

k

the transformation function

returns

a partial function with the domain of other partial function narrowed by
this partial function, which maps arguments x to this(k(x)).

Returns a new map containing the elements from the left hand operand followed by the elements from the
right hand operand.

Returns a new map containing the elements from the left hand operand followed by the elements from the
right hand operand. The element type of the map is the most specific superclass encompassing
the element types of the two operands.

suffix

the traversable to append.

returns

a new map which contains all elements
of this map followed by all elements of suffix.

Returns a new iterable collection containing the elements from the left hand operand followed by the elements from the
right hand operand.

Returns a new iterable collection containing the elements from the left hand operand followed by the elements from the
right hand operand. The element type of the iterable collection is the most specific superclass encompassing
the element types of the two operands.

B

the element type of the returned collection.

suffix

the traversable to append.

returns

a new iterable collection which contains all elements
of this iterable collection followed by all elements of suffix.

Note: might return different results for different runs, unless the underlying collection type is ordered.

n

the number of elements to drop from this iterable collection.

returns

a iterable collection consisting of all elements of this iterable collection except the first n ones, or else the
empty iterable collection, if this iterable collection has less than n elements.
If n is negative, don't drop any elements.

Reuse:
After calling this method, one should discard the iterator it was called
on, and use only the iterator that was returned. Using the old iterator
is undefined, subject to change, and may result in changes to the new
iterator as well.

Note: might return different results for different runs, unless the underlying collection type is ordered.

n

the number of elements to drop from this iterable collection.

returns

a iterable collection consisting of all elements of this iterable collection except the last n ones, or else the
empty iterable collection, if this iterable collection has less than n elements.
If n is negative, don't drop any elements.

Reuse:
After calling this method, one should discard the iterator it was called
on, and use only the iterator that was returned. Using the old iterator
is undefined, subject to change, and may result in changes to the new
iterator as well.

Reuse:
After calling this method, one should discard the iterator it was called
on, and use only the iterator that was returned. Using the old iterator
is undefined, subject to change, and may result in changes to the new
iterator as well.

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:

It is consistent: for any non-null instances x and y of type AnyRef, multiple invocations of
x.eq(y) consistently returns true or consistently returns false.

For any non-null instance 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).

returns

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

Reuse:
After calling this method, one should discard the iterator it was called
on, and use only the iterator that was returned. Using the old iterator
is undefined, subject to change, and may result in changes to the new
iterator as well.

Reuse:
After calling this method, one should discard the iterator it was called
on, and use only the iterator that was returned. Using the old iterator
is undefined, subject to change, and may result in changes to the new
iterator as well.

Folds the elements of this collection using the specified associative binary operator.

Folds the elements of this collection using the specified associative binary operator.
The default implementation in IterableOnce is equivalent to foldLeft but may be
overridden for more efficient traversal orders.

The order in which operations are performed on elements is unspecified
and may be nondeterministic.

Note: will not terminate for infinite-sized collections.

A1

a type parameter for the binary operator, a supertype of A.

z

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

op

a binary operator that must be associative.

returns

the result of applying the fold operator op between all the elements and z, or z if this collection is empty.

This process can be done in a strict way or a non-strict way (ie. without evaluating
the elements of the resulting collections). In other words, this methods defines
the evaluation model of the collection.

As witnessed by the @uncheckedVariance annotation, using this method
might be unsound. However, as long as it is called with an
Iterable[A] obtained from this collection (as it is the case in the
implementations of operations where we use a View[A]), it is safe.

Partitions this iterable collection into a map of iterable collections according to a discriminator function key.

Partitions this iterable collection into a map of iterable collections according to a discriminator function key.
Each element in a group is transformed into a value of type B using the value function.

It is equivalent to groupBy(key).mapValues(_.map(f)), but more efficient.

Partitions this iterable collection into a map according to a discriminator function key.

Partitions this iterable collection into a map according to a discriminator function key. All the values that
have the same discriminator are then transformed by the value function and then reduced into a
single value with the reduce function.

It is equivalent to groupBy(key).mapValues(_.map(f).reduce(reduce)), but more efficient.

Iterates over the inits of this iterable collection. The first value will be this
iterable collection and the final one will be an empty iterable collection, with the intervening
values the results of successive applications of init.

Note: Even when applied to a view or a lazy collection it will always force the elements.

Note that the result of the test is modulo Scala's erasure semantics.
Therefore the expression 1.isInstanceOf[String] will return false, while the
expression List(1).isInstanceOf[List[String]] will return true.
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 specified type.

returns

true if the receiver object is an instance of erasure of type T0; false otherwise.

This operation has to be overridden by concrete collection classes to effectively
return an IterableFactory[IterableCC]. The implementation in Iterable only returns
an IterableFactory[Iterable], but the compiler will not throw an error if the
effective IterableCC type constructor is more specific than Iterable.

Reuse:
After calling this method, one should discard the iterator it was called
on, and use only the iterator that was returned. Using the old iterator
is undefined, subject to change, and may result in changes to the new
iterator as well.

This operation has to be overridden by concrete collection classes to effectively
return a MapFactory[MapCC]. The implementation in Map only returns
a MapFactory[Map], but the compiler will not throw an error if the
effective MapCC type constructor is more specific than Map.

a string representation of this collection. In the resulting string
the string representations (w.r.t. the method toString)
of all elements of this collection follow each other without any
separator string.

Displays all elements of this collection in a string using start, end, and
separator strings.

Displays all elements of this collection in a string using start, end, and
separator strings.

Delegates to addString, which can be overridden.

start

the starting string.

sep

the separator string.

end

the ending string.

returns

a string representation of this collection. The resulting string
begins with the string start and ends with the string
end. Inside, the string representations (w.r.t. the method
toString) of all elements of this collection are separated by
the string sep.

a strict builder for the same collection type.
Note that in the case of lazy collections (e.g. View or immutable.LazyList),
it is possible to implement this method but the resulting Builder will break laziness.
As a consequence, operations should preferably be implemented with fromSpecific
instead of this method.

Composes this partial function with a fallback partial function which
gets applied where this partial function is not defined.

Composes this partial function with a fallback partial function which
gets applied where this partial function is not defined.

A1

the argument type of the fallback function

B1

the result type of the fallback function

that

the fallback function

returns

a partial function which has as domain the union of the domains
of this partial function and that. The resulting partial function
takes x to this(x) where this is defined, and to that(x) where it is not.

A pair of, first, all elements that satisfy predicate p and, second,
all elements that do not.

A pair of, first, all elements that satisfy predicate p and, second,
all elements that do not. Interesting because it splits a collection in two.

The default implementation provided here needs to traverse the collection twice.
Strict collections have an overridden version of partition in StrictOptimizedIterableOps,
which requires only a single traversal.

Applies a function f to each element of the iterable collection and returns a pair of iterable collections: the first one
made of those values returned by f that were wrapped in scala.util.Left, and the second
one made of those wrapped in scala.util.Right.

Applies a function f to each element of the iterable collection and returns a pair of iterable collections: the first one
made of those values returned by f that were wrapped in scala.util.Left, and the second
one made of those wrapped in scala.util.Right.

Reuse:
After calling this method, one should discard the iterator it was called
on, and use only the iterator that was returned. Using the old iterator
is undefined, subject to change, and may result in changes to the new
iterator as well.

The method as implemented here does not call size directly; its running time
is O(this.size min that.size) instead of O(this.size + that.size).
The method should be overwritten if computing size is cheap.

Gives a hint that one expects the result of this builder
to have the same size as the given collection, plus some delta.

Gives a hint that one expects the result of this builder
to have the same size as the given collection, plus some delta. This will
provide a hint only if the collection has a known size
Some builder classes
will optimize their representation based on the hint. However,
builder implementations are still required to work correctly even if the hint is
wrong, i.e. a different number of elements is added.

Gives a hint how many elements are expected to be added
when the next result is called.

Gives a hint how many elements are expected to be added
when the next result is called. Some builder classes
will optimize their representation based on the hint. However,
builder implementations are still required to work correctly even if the hint is
wrong, i.e. a different number of elements is added.

Gives a hint how many elements are expected to be added
when the next result is called, together with an upper bound
given by the size of some other collection.

Gives a hint how many elements are expected to be added
when the next result is called, together with an upper bound
given by the size of some other collection. Some builder classes
will optimize their representation based on the hint. However,
builder implementations are still required to work correctly even if the hint is
wrong, i.e. a different number of elements is added.

size

the hint how many elements will be added.

boundingColl

the bounding collection. If it is
an IndexedSeqLike, then sizes larger
than collection's size are reduced.

Reuse:
After calling this method, one should discard the iterator it was called
on, and use only the iterator that was returned. Using the old iterator
is undefined, subject to change, and may result in changes to the new
iterator as well.

Reuse:
After calling this method, one should discard the iterator it was called
on, and use only the iterators that were returned. Using the old iterator
is undefined, subject to change, and may result in changes to the new
iterators as well.

Reuse:
After calling this method, one should discard the iterator it was called
on, and use only the iterators that were returned. Using the old iterator
is undefined, subject to change, and may result in changes to the new
iterators as well.

Iterates over the tails of this iterable collection. The first value will be this
iterable collection and the final one will be an empty iterable collection, with the intervening
values the results of successive applications of tail.

Note: might return different results for different runs, unless the underlying collection type is ordered.

n

the number of elements to take from this iterable collection.

returns

a iterable collection consisting only of the first n elements of this iterable collection,
or else the whole iterable collection, if it has less than n elements.
If n is negative, returns an empty iterable collection.

Reuse:
After calling this method, one should discard the iterator it was called
on, and use only the iterator that was returned. Using the old iterator
is undefined, subject to change, and may result in changes to the new
iterator as well.

Note: might return different results for different runs, unless the underlying collection type is ordered.

n

the number of elements to take from this iterable collection.

returns

a iterable collection consisting only of the last n elements of this iterable collection,
or else the whole iterable collection, if it has less than n elements.
If n is negative, returns an empty iterable collection.

Reuse:
After calling this method, one should discard the iterator it was called
on, and use only the iterator that was returned. Using the old iterator
is undefined, subject to change, and may result in changes to the new
iterator as well.

Reuse:
After calling this method, one should discard the iterator it was called
on, and use only the iterator that was returned. Using the old iterator
is undefined, subject to change, and may result in changes to the new
iterator as well.

Applies a side-effecting function to each element in this collection.
Strict collections will apply f to their elements immediately, while lazy collections
like Views and LazyLists will only apply f on each element if and when that element
is evaluated, and each time that element is evaluated.

Creates a String representation of this object. The default
representation is platform dependent. On the java platform it
is the concatenation of the class name, "@", and the object's
hashcode in hexadecimal.

Update a mapping for the specified key and its current optionally-mapped value
(Some if there is current mapping, None if not).

Update a mapping for the specified key and its current optionally-mapped value
(Some if there is current mapping, None if not).

If the remapping function returns Some(v), the mapping is updated with the new value v.
If the remapping function returns None, the mapping is removed (or remains absent if initially absent).
If the function itself throws an exception, the exception is rethrown, and the current mapping is left unchanged.

key

the key value

remappingFunction

a partial function that receives current optionally-mapped value and return a new mapping

Note: the difference between c filter p and c withFilter p is that
the former creates a new collection, whereas the latter only
restricts the domain of subsequent map, flatMap, foreach,
and withFilter operations.

Note: might return different results for different runs, unless the underlying collection type is ordered.

p

the predicate used to test elements.

returns

an object of class WithFilter, which supports
map, flatMap, foreach, and withFilter operations.
All these operations apply to those elements of this map
which satisfy the predicate p.

Returns a iterable collection formed from this iterable collection and another iterable collection
by combining corresponding elements in pairs.

Returns a iterable collection formed from this iterable collection and another iterable collection
by combining corresponding elements in pairs.
If one of the two collections is longer than the other, its remaining elements are ignored.

B

the type of the second half of the returned pairs

that

The iterable providing the second half of each result pair

returns

a new iterable collection containing pairs consisting of corresponding elements of this iterable collection and that.
The length of the returned collection is the minimum of the lengths of this iterable collection and that.

Returns a iterable collection formed from this iterable collection and another iterable collection
by combining corresponding elements in pairs.

Returns a iterable collection formed from this iterable collection and another iterable collection
by combining corresponding elements in pairs.
If one of the two collections is shorter than the other,
placeholder elements are used to extend the shorter collection to the length of the longer.

that

the iterable providing the second half of each result pair

thisElem

the element to be used to fill up the result if this iterable collection is shorter than that.

thatElem

the element to be used to fill up the result if that is shorter than this iterable collection.

returns

a new collection of type That containing pairs consisting of
corresponding elements of this iterable collection and that. The length
of the returned collection is the maximum of the lengths of this iterable collection and that.
If this iterable collection is shorter than that, thisElem values are used to pad the result.
If that is shorter than this iterable collection, thatElem values are used to pad the result.

Reuse:
After calling this method, one should discard the iterator it was called
on, and use only the iterator that was returned. Using the old iterator
is undefined, subject to change, and may result in changes to the new
iterator as well.

Tests whether this collection is known to have a finite size.
All strict collections are known to have finite size. For a non-strict
collection such as Stream, the predicate returns true if all
elements have been computed. It returns false if the stream is
not yet evaluated to the end. Non-empty Iterators usually return
false even if they were created from a collection with a known
finite size.

Note: many collection methods will not work on collections of infinite sizes.
The typical failure mode is an infinite loop. These methods always attempt a
traversal without checking first that hasDefiniteSize returns true.
However, checking hasDefiniteSize can provide an assurance that size is
well-defined and non-termination is not a concern.

returns

true if this collection is known to have finite size,
false otherwise.