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

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

Appends all elements of this collection 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 collection are separated by the string sep.

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.

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.

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.

When implementing a custom collection type and refining C to the new type, this
method needs to be overridden (the compiler will issue an error otherwise). In the
common case where C =:= CC[A], this can be done by mixing in the
IterableFactoryDefaults trait, which implements the method using
iterableFactory.

,

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.

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.

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.

When implementing a custom collection type and refining C to the new type, this
method needs to be overridden (the compiler will issue an error otherwise). In the
common case where C =:= CC[A], this can be done by mixing in the
IterableFactoryDefaults trait, which implements the method using
iterableFactory.

,

As witnessed by the @uncheckedVariance annotation, using this method might
be unsound. However, as long as the returned builder is only fed
with A values taken from this instance, it is safe.

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 overridden if computing size is cheap and knownSize returns -1.

The method as implemented here does not call size directly; its running time
is O(size min otherSize) instead of O(size). The method should be overridden
if computing size is cheap and knownSize returns -1.

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.

The Stepper enables creating a Java stream to operate on the collection, see
scala.jdk.StreamConverters. For collections holding primitive values, the Stepper can be
used as an iterator which doesn't box the elements.

The implicit StepperShape parameter defines the resulting Stepper type according to the
element type of this collection.

For collections of Int, Short, Byte or Char, an IntStepper is returned

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.

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.

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 iterable collection
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.