|
Scala 2.3.1
|
abstract
trait
Iterable
[A]
extends
java.lang.Object
with
scala.ScalaObject
elements
which returns an iterator over all the
elements contained in the collection.Def Summary | |
def
/:
[B]
(z: B)(f: (B, A) => B)
: B
Similar to foldLeft but can be used as
an operator with the order of list and zero arguments reversed.
That is, z /: xs is the same as xs foldLeft z
|
|
def
:\
[B]
(z: B)(f: (A, B) => B)
: B
An alias for foldRight .
That is, xs :\ z is the same as xs foldRight z
|
|
def
concat
[B >: A]
(that: scala.Iterable[B])
: scala.Iterable[B]
Concatenates two iterable objects |
|
abstract
|
def
elements
: scala.Iterator[A]
Creates a new iterator over all elements contained in this object. |
def
exists
(p: (A) => scala.Boolean)
: scala.Boolean
Apply a predicate p to all elements of this
iterable object and return true, iff there is at least one
element for which p yields true.
|
|
def
find
(p: (A) => scala.Boolean)
: scala.Option[A]
Find and return the first element of the iterable object satisfying a predicate, if any. |
|
def
findIndexOf
(p: (A) => scala.Boolean)
: scala.Int
Returns index of the first element satisying a predicate, or -1. |
|
def
foldLeft
[B]
(z: B)(op: (B, A) => B)
: B
Combines the elements of this list together using the binary operator op , from left to right, and starting with
the value z .
|
|
def
foldRight
[B]
(z: B)(op: (A, B) => B)
: B
Combines the elements of this list together using the binary operator op , from rigth to left, and starting with
the value z .
|
|
def
forall
(p: (A) => scala.Boolean)
: scala.Boolean
Apply a predicate p to all elements of this
iterable object and return true, iff the predicate yields
true for all elements.
|
|
def
foreach
(f: (A) => scala.Unit)
: scala.Unit
Apply a function f to all elements of this
iterable object.
|
|
def
indexOf
[B >: A]
(elem: B)
: scala.Int
Returns the index of the first occurence of the specified object in this iterable object. |
|
def
sameElements
[B >: A]
(that: scala.Iterable[B])
: scala.Boolean
Checks if the other iterable object contains the same elements. |
|
def
toList
: scala.List[A]
|
Def Detail |
foldLeft
but can be used as
an operator with the order of list and zero arguments reversed.
That is, z /: xs
is the same as xs foldLeft z
foldRight
.
That is, xs :\ z
is the same as xs foldRight z
def
concat
[B >: A](that: scala.Iterable[B]): scala.Iterable[B]
abstract
def
elements
: scala.Iterator[A]
def
exists
(p: (A) => scala.Boolean): scala.Boolean
p
to all elements of this
iterable object and return true, iff there is at least one
element for which p
yields true.p -
the predicate
def
find
(p: (A) => scala.Boolean): scala.Option[A]
p -
the predicate
p
, or None
if none exists.
def
findIndexOf
(p: (A) => scala.Boolean): scala.Int
p -
the predicate
p
, or -1 if such an element does not exist
op
, from left to right, and starting with
the value z
.op(... (op(op(z,a0),a1) ...), an)
if the list is List(a0, a1, ..., an)
.
op
, from rigth to left, and starting with
the value z
.a0 op (... op (an op z)...)
if the list is [a0, a1, ..., an]
.
def
forall
(p: (A) => scala.Boolean): scala.Boolean
p
to all elements of this
iterable object and return true, iff the predicate yields
true for all elements.p -
the predicate
def
foreach
(f: (A) => scala.Unit): scala.Unit
f
to all elements of this
iterable object.f -
a function that is applied to every element.
elem -
element to search for.
def
sameElements
[B >: A](that: scala.Iterable[B]): scala.Boolean
that -
the other iterable object
def
toList
: scala.List[A]