o != arg0
is the same as !(o == (arg0))
.
o != arg0
is the same as !(o == (arg0))
.
the object to compare against this object for dis-equality .
false
if the receiver object is equivalent to the argument; true
otherwise.
Applies a binary operator to a start value and all elements of this traversable or iterator, going left to right .
Applies a binary operator to a start value and all elements of this traversable or iterator, going left to right .
Note: /:
is alternate syntax for foldLeft
; z /: xs
is the same as xs foldLeft z
.
Note: will not terminate for infinite-sized collections.
Note: might return different results for different runs, unless the underlying collection type is ordered or the operator is associative and commutative.
the result type of the binary operator .
the start value .
the binary operator .
the result of inserting op
between consecutive elements of this traversable or iterator,
going left to right with the start value z
on the left:
op(...op(op(z, x1), x2), ..., xn)
where x,,1,,, ..., x,,n,,
are the elements of this traversable or iterator.
Applies a binary operator to all elements of this traversable or iterator and a start value, going right to left .
Applies a binary operator to all elements of this traversable or iterator and a start value, going right to left .
Note: :\
is alternate syntax for foldRight
; xs :\ z
is the same as xs foldRight z
.
Note: will not terminate for infinite-sized collections.
Note: might return different results for different runs, unless the underlying collection type is ordered or the operator is associative and commutative.
the result type of the binary operator .
the start value
the binary operator
the result of inserting op
between consecutive elements of this traversable or iterator,
going right to left with the start value z
on the right:
op(x1, op(x2, ... op(xn, z)...))
where x,,1,,, ..., x,,n,,
are the elements of this traversable or iterator.
o == arg0
is the same as if (o eq null) arg0 eq null else o.equals(arg0)
.
o == arg0
is the same as if (o eq null) arg0 eq null else o.equals(arg0)
.
the object to compare against this object for equality .
true
if the receiver object is equivalent to the argument; false
otherwise.
o == arg0
is the same as o.equals(arg0)
.
o == arg0
is the same as o.equals(arg0)
.
the object to compare against this object for equality .
true
if the receiver object is equivalent to the argument; false
otherwise.
Appends all elements of this traversable or iterator to a string builder .
Appends all elements of this traversable or iterator to a string builder.
The written text consists of the string representations (w.r.t. the method toString
)
of all elements of this traversable or iterator without any separator string.
the string builder to which elements are appended .
the string builder b
to which elements were appended.
Appends all elements of this traversable or iterator to a string builder using a separator string .
Appends all elements of this traversable or iterator 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 traversable or iterator, separated by the string sep
.
the string builder to which elements are appended .
the separator string .
the string builder b
to which elements were appended.
Appends all elements of this traversable or iterator to a string builder using start, end, and separator strings .
Appends all elements of this traversable or iterator 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 traversable or iterator are separated by the string sep
.
the string builder to which elements are appended .
the starting string .
the separator string .
the ending string .
the string builder b
to which elements were appended.
This method is used to cast the receiver object to be of type T0
.
This method is used to 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 expression1.asInstanceOf[String]
will throw a ClassCastException
at runtime, while the expressionList(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 typed.
the receiver object .
This method creates and returns a copy of the receiver object .
This method creates and returns a copy of the receiver object .
The default implementation of the clone
method is platform dependent.
a copy of the receiver object .
[use case] Copies values of this traversable or iterator to an array .
Copies values of this traversable or iterator to an array.
Fills the given array xs
with values of this traversable or iterator.
Copying will stop once either the end of the current traversable or iterator is reached,
or the end of the array is reached.
the array to fill .
Copies values of this traversable or iterator to an array .
Copies values of this traversable or iterator to an array.
Fills the given array xs
with values of this traversable or iterator.
Copying will stop once either the end of the current traversable or iterator is reached,
or the end of the array is reached.
Note: will not terminate for infinite-sized collections.
the type of the elements of the array .
the array to fill .
[use case] Copies values of this traversable or iterator to an array .
Copies values of this traversable or iterator to an array.
Fills the given array xs
with values of this traversable or iterator, after skipping start
values.
Copying will stop once either the end of the current traversable or iterator is reached,
or the end of the array is reached.
the array to fill .
the starting index .
Copies values of this traversable or iterator to an array .
Copies values of this traversable or iterator to an array.
Fills the given array xs
with values of this traversable or iterator, after skipping start
values.
Copying will stop once either the end of the current traversable or iterator is reached,
or the end of the array is reached.
Note: will not terminate for infinite-sized collections.
the type of the elements of the array .
the array to fill .
the starting index .
Copies all elements of this traversable or iterator to a buffer .
Copies all elements of this traversable or iterator to a buffer .
Note: will not terminate for infinite-sized collections.
The buffer to which elements are copied .
Counts the number of elements in the traversable or iterator which satisfy a predicate .
Counts the number of elements in the traversable or iterator which satisfy a predicate .
the predicate used to test elements .
the number of elements satisfying the predicate p
.
This method is used to test whether the argument (arg0
) is a reference to the
receiver object (this
).
This method is used to test whether the argument (arg0
) is a reference to the
receiver object (this
).
The eq
method implements an [http://en.wikipedia.org/wiki/Equivalence_relation equivalence relation] on
non-null instances of AnyRef
:
* It is reflexive: for any non-null instance x
of type AnyRef
, x.eq(x)
returns true
.
* It is symmetric: for any non-null instances x
and y
of type AnyRef
, x.eq(y)
returns true
if and
only if y.eq(x)
returns true
.
* It is transitive: for any non-null instances x
, y
, and z
of type AnyRef
if x.eq(y)
returns true
and y.eq(z)
returns true
, then x.eq(z)
returns true
.
Additionally, the eq
method has three other 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
).
the object to compare against this object for reference equality .
true
if the argument is a reference to the receiver object; false
otherwise.
This method is used to compare the receiver object (this
) with the argument object (arg0
) for equivalence.
This method is used to compare the receiver object (this
) with the argument object (arg0
) for equivalence.
The default implementations of this method is an [http://en.wikipedia.org/wiki/Equivalence_relation equivalence
relation]:
* It is reflexive: for any instance x
of type Any
, x.equals(x)
should return true
.
* It is symmetric: for any instances x
and y
of type Any
, x.equals(y)
should return true
if and
only if y.equals(x)
returns true
.
* It is transitive: for any instances x
, y
, and z
of type AnyRef
if x.equals(y)
returns true
and
y.equals(z)
returns true
, then x.equals(z)
should return true
.
If you override this method, you should verify that your implementation remains an equivalence relation.
Additionally, when overriding this method it is often necessary to override hashCode
to ensure that objects
that are "equal" (o1.equals(o2)
returns true
) hash to the same
scala.Int
(o1.hashCode.equals(o2.hashCode)
).
the object to compare against this object for equality .
true
if the receiver object is equivalent to the argument; false
otherwise.
This method is called by the garbage collector on the receiver object when garbage collection determines that there are no more references to the object .
This method is called by the garbage collector on the receiver object when garbage collection determines that there are no more references to the object .
The details of when and if the finalize
method are invoked, as well as the interaction between finalize
and non-local returns and exceptions, are all platform dependent.
Applies a binary operator to a start value and all elements of this traversable or iterator, going left to right .
Applies a binary operator to a start value and all elements of this traversable or iterator, going left to right .
Note: will not terminate for infinite-sized collections.
Note: might return different results for different runs, unless the underlying collection type is ordered or the operator is associative and commutative.
the result type of the binary operator .
the start value .
the binary operator .
the result of inserting op
between consecutive elements of this traversable or iterator,
going left to right with the start value z
on the left:
op(...op(z, x1), x2, ..., xn)
where x,,1,,, ..., x,,n,,
are the elements of this traversable or iterator.
Applies a binary operator to all elements of this traversable or iterator and a start value, going right to left .
Applies a binary operator to all elements of this traversable or iterator and a start value, going right to left .
Note: will not terminate for infinite-sized collections.
Note: might return different results for different runs, unless the underlying collection type is ordered or the operator is associative and commutative.
the result type of the binary operator .
the start value .
the binary operator .
the result of inserting op
between consecutive elements of this traversable or iterator,
going right to left with the start value z
on the right:
op(x1, op(x2, ... op(xn, z)...))
where x,,1,,, ..., x,,n,,
are the elements of this traversable or iterator.
Presently these are abstract because the Traversable versions use breakable/break, and I wasn't sure enough of how that's supposed to function to consolidate them with the Iterator versions .
Presently these are abstract because the Traversable versions use breakable/break, and I wasn't sure enough of how that's supposed to function to consolidate them with the Iterator versions .
Self-documenting abstract methods .
Self-documenting abstract methods .
Returns a representation that corresponds to the dynamic class of the receiver object .
Returns a representation that corresponds to the dynamic class of the receiver object .
The nature of the representation is platform dependent.
a representation that corresponds to the dynamic class of the receiver object .
Returns a hash code value for the object .
Returns a hash code value for the object .
The default hashing algorithm is platform dependent.
Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)
) yet
not be equal (o1.equals(o2)
returns false
). A degenerate implementation could always return 0
.
However, it is required that if two objects are equal (o1.equals(o2)
returns true
) that they have
identical hash codes (o1.hashCode.equals(o2.hashCode)
). Therefore, when overriding this method, be sure
to verify that the behavior is consistent with the equals
method.
the hash code value for the object .
This method is used to test whether the dynamic type of the receiver object is T0
.
This method is used to test whether the dynamic type of the receiver object is T0
.
Note that the test result of the test is modulo Scala's erasure semantics. Therefore the expression1.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 requested typed.
true
if the receiver object is an instance of erasure of type T0
; false
otherwise.
Tests whether this traversable or iterator can be repeatedly traversed .
Tests whether this traversable or iterator can be repeatedly traversed . Always true for Traversables and false for Iterators unless overridden.
true
if it is repeatedly traversable, false
otherwise.
[use case] Finds the largest element .
Finds the largest element .
the largest element of this traversable or iterator .
Finds the largest element .
Finds the largest element .
The type over which the ordering is defined .
An ordering to be used for comparing elements .
the largest element of this traversable or iterator with respect to the ordering cmp
.
[use case] Finds the smallest element .
Finds the smallest element .
the smallest element of this traversable or iterator
Finds the smallest element .
Finds the smallest element .
The type over which the ordering is defined .
An ordering to be used for comparing elements .
the smallest element of this traversable or iterator with respect to the ordering cmp
.
Displays all elements of this traversable or iterator in a string .
Displays all elements of this traversable or iterator in a string .
a string representation of this traversable or iterator. In the resulting string
the string representations (w.r.t. the method toString
)
of all elements of this traversable or iterator follow each other without any separator string.
Displays all elements of this traversable or iterator in a string using a separator string .
Displays all elements of this traversable or iterator in a string using a separator string .
the separator string .
a string representation of this traversable or iterator. In the resulting string
the string representations (w.r.t. the method toString
)
of all elements of this traversable or iterator are separated by the string sep
.
Displays all elements of this traversable or iterator in a string using start, end, and separator strings .
Displays all elements of this traversable or iterator in a string using start, end, and separator strings .
the starting string .
the separator string .
the ending string .
a string representation of this traversable or iterator. 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 traversable or iterator are separated by the string sep
.
o.ne(arg0)
is the same as !(o.eq(arg0))
.
o.ne(arg0)
is the same as !(o.eq(arg0))
.
the object to compare against this object for reference dis-equality .
false
if the argument is not a reference to the receiver object; true
otherwise.
Tests whether the traversable or iterator is not empty .
Tests whether the traversable or iterator is not empty .
true
if the traversable or iterator contains at least one element, false
otherwise.
Wakes up a single thread that is waiting on the receiver object's monitor .
Wakes up a single thread that is waiting on the receiver object's monitor .
Wakes up all threads that are waiting on the receiver object's monitor .
Wakes up all threads that are waiting on the receiver object's monitor .
[use case] Multiplies up the elements of this collection .
Multiplies up the elements of this collection .
the product of all elements in this traversable or iterator of numbers of type Int
.
Instead of Int
, any other type T
with an implicit Numeric[T]
implementation
can be used as element type of the traversable or iterator and as result type of product
.
Examples of such types are: Long
, Float
, Double
, BigInt
.
Multiplies up the elements of this collection .
Multiplies up the elements of this collection .
the result type of the *
operator.
an implicit parameter defining a set of numeric operations
which includes the *
operator to be used in forming the product.
the product of all elements of this traversable or iterator with respect to the *
operator in num
.
Applies a binary operator to all elements of this traversable or iterator, going left to right .
Applies a binary operator to all elements of this traversable or iterator, going left to right .
Note: will not terminate for infinite-sized collections.
Note: might return different results for different runs, unless the underlying collection type is ordered or the operator is associative and commutative.
the result type of the binary operator .
the binary operator .
the result of inserting op
between consecutive elements of this traversable or iterator,
going left to right:
op(...(op(x1, x2), ... ) , xn)
where x,,1,,, ..., x,,n,,
are the elements of this traversable or iterator.
Optionally applies a binary operator to all elements of this traversable or iterator, going left to right .
Optionally applies a binary operator to all elements of this traversable or iterator, going left to right .
Note: will not terminate for infinite-sized collections.
Note: might return different results for different runs, unless the underlying collection type is ordered or the operator is associative and commutative.
the result type of the binary operator .
the binary operator .
an option value containing the result of reduceLeft(op)
is this traversable or iterator is nonempty,
None
otherwise.
Applies a binary operator to all elements of this traversable or iterator, going right to left .
Applies a binary operator to all elements of this traversable or iterator, going right to left .
Note: will not terminate for infinite-sized collections.
Note: might return different results for different runs, unless the underlying collection type is ordered or the operator is associative and commutative.
the result type of the binary operator .
the binary operator .
the result of inserting op
between consecutive elements of this traversable or iterator,
going right to left:
op(x1, op(x2, ..., op(xn-1, xn)...))
where x,,1,,, ..., x,,n,,
are the elements of this traversable or iterator.
Optionally applies a binary operator to all elements of this traversable or iterator, going right to left .
Optionally applies a binary operator to all elements of this traversable or iterator, going right to left .
Note: will not terminate for infinite-sized collections.
Note: might return different results for different runs, unless the underlying collection type is ordered or the operator is associative and commutative.
the result type of the binary operator .
the binary operator .
an option value containing the result of reduceRight(op)
is this traversable or iterator is nonempty,
None
otherwise.
The size of this traversable or iterator .
The size of this traversable or iterator .
Note: will not terminate for infinite-sized collections.
the number of elements in this traversable or iterator .
[use case] Sums up the elements of this collection .
Sums up the elements of this collection .
the sum of all elements in this traversable or iterator of numbers of type Int
.
Instead of Int
, any other type T
with an implicit Numeric[T]
implementation
can be used as element type of the traversable or iterator and as result type of sum
.
Examples of such types are: Long
, Float
, Double
, BigInt
.
Sums up the elements of this collection .
Sums up the elements of this collection .
the result type of the +
operator.
an implicit parameter defining a set of numeric operations
which includes the +
operator to be used in forming the sum.
the sum of all elements of this traversable or iterator with respect to the +
operator in num
.
[use case] Converts this traversable or iterator to an array .
Converts this traversable or iterator to an array .
Note: will not terminate for infinite-sized collections.
an array containing all elements of this traversable or iterator.
A ClassManifest
must be available for the element type of this traversable or iterator.
Converts this traversable or iterator to an array .
Converts this traversable or iterator to an array .
Note: will not terminate for infinite-sized collections.
the type of the elements of the array. A ClassManifest
for this type must
be available.
an array containing all elements of this traversable or iterator .
Converts this traversable or iterator to an indexed sequence .
Converts this traversable or iterator to an indexed sequence .
Note: will not terminate for infinite-sized collections.
an indexed sequence containing all elements of this traversable or iterator .
Converts this traversable or iterator to an iterable collection .
Converts this traversable or iterator to an iterable collection .
Note: will not terminate for infinite-sized collections.
an Iterable
containing all elements of this traversable or iterator.
Returns an Iterator over the elements in this traversable or iterator .
Returns an Iterator over the elements in this traversable or iterator . Will return the same Iterator if this instance is already an Iterator.
Note: will not terminate for infinite-sized collections.
an Iterator containing all elements of this traversable or iterator .
Converts this traversable or iterator to a list .
Converts this traversable or iterator to a list .
Note: will not terminate for infinite-sized collections.
a list containing all elements of this traversable or iterator .
Converts this traversable or iterator to a map .
Converts this traversable or iterator to a map . This method is unavailable unless the elements are members of Tuple2, each ((K, V)) becoming a key-value pair in the map. Duplicate keys will be overwritten by later keys: if this is an unordered collection, which key is in the resulting map is undefined.
Note: will not terminate for infinite-sized collections.
a map containing all elements of this traversable or iterator .
Converts this traversable or iterator to a sequence .
Converts this traversable or iterator to a sequence .
Note: will not terminate for infinite-sized collections.
a sequence containing all elements of this traversable or iterator .
Converts this traversable or iterator to a set .
Converts this traversable or iterator to a set .
Note: will not terminate for infinite-sized collections.
a set containing all elements of this traversable or iterator .
Converts this traversable or iterator to a stream .
Converts this traversable or iterator to a stream .
Note: will not terminate for infinite-sized collections.
a stream containing all elements of this traversable or iterator .
Returns a string representation of the object .
Returns a string representation of the object .
The default representation is platform dependent.
a string representation of the object .
Converts this traversable or iterator to an unspecified Traversable .
Converts this traversable or iterator to an unspecified Traversable . Will return the same collection if this instance is already Traversable.
Note: will not terminate for infinite-sized collections.
a Traversable containing all elements of this traversable or iterator .
A template trait for collections which can be traversed either once only or one or more times .
This trait is composed of those methods which can be implemented solely in terms of foreach and which do not need access to a Builder. It represents the implementations common to Iterators and Traversables, such as folds, conversions, and other operations which traverse some or all of the elements and return a derived value.
the element type of the collection
version
2 . 8
since
2 . 8
authors: ,
Paul Phillips
Martin Odersky