in scala
trait Iterable

`abstract trait` Iterable [A]
  `extends` java.lang.Object
  `with` scala.ScalaObject

  Collection classes mixing in this class provide a method `elements` which returns an iterator over all the elements contained in the collection.

Author:
  Matthias Zenger
Version:
  1.1, 04/02/2004

Direct Known Subclasses:
  MetaData, History, Set, Map, Seq, Option, IterableProxy, Relation

Def Summary
| `def` /: [B] (z: B)(f: scala.Function2[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: scala.Function2[A, B, B]) : B An alias for `foldRight`. That is, `xs :\ z` is the same as `xs foldRight z`
| `def` concat [A <: B] (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: scala.Function1[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: scala.Function1[A, scala.Boolean]) : scala.Option[A] Find and return the first element of the iterable object satisfying a predicate, if any.
| `def` foldLeft [B] (z: B)(op: scala.Function2[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: scala.Function2[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: scala.Function1[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: scala.Function1[A, scala.Unit]) : scala.Unit Apply a function `f` to all elements of this iterable object.
| `def` indexOf (p: scala.Function1[A, scala.Boolean]) : scala.Int Returns index of the first element satisying a predicate, or -1.
| `def` sameElements [A <: B] (that: scala.Iterable[B]) : scala.Boolean Checks if the other iterable object contains the same elements.
| `def` toList : scala.List[A]

Def Detail

`def` /: [B](z: B)(f: scala.Function2[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: scala.Function2[A, B, B]): B

  An alias for `foldRight`. That is, `xs :\ z` is the same as `xs foldRight z`

`def` concat [A <: B](that: scala.Iterable[B]): scala.Iterable[B]

  Concatenates two iterable objects

Returns:
  the new iterable object
Author:
  buraq

`abstract def` elements : scala.Iterator[A]

  Creates a new iterator over all elements contained in this object.

Returns:
  the new iterator

`def` exists (p: scala.Function1[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.

Parameters:
  `p -` the predicate
Returns:
  true, iff the predicate yields true for at least one element.

`def` find (p: scala.Function1[A, scala.Boolean]): scala.Option[A]

  Find and return the first element of the iterable object satisfying a predicate, if any.

Parameters:
  `p -` the predicate
Returns:
  the first element in the iterable object satisfying `p`, or `None` if none exists.

`def` foldLeft [B](z: B)(op: scala.Function2[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`.

Returns:
  `op(... (op(op(z,a0),a1) ...), an)` if the list is `List(a0, a1, ..., an)`.

`def` foldRight [B](z: B)(op: scala.Function2[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`.

Returns:
  `a0 op (... op (an op z)...)` if the list is `[a0, a1, ..., an]`.

`def` forall (p: scala.Function1[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.

Parameters:
  `p -` the predicate
Returns:
  true, iff the predicate yields true for all elements.

`def` foreach (f: scala.Function1[A, scala.Unit]): scala.Unit

  Apply a function `f` to all elements of this iterable object.

Parameters:
  `f -` a function that is applied to every element.

`def` indexOf (p: scala.Function1[A, scala.Boolean]): scala.Int

  Returns index of the first element satisying a predicate, or -1.

Parameters:
  `p -` the predicate
Returns:
  the index of the first element satisfying `p`, or -1 if such an element does not exist

`def` sameElements [A <: B](that: scala.Iterable[B]): scala.Boolean

  Checks if the other iterable object contains the same elements.

Parameters:
  `that -` the other iterable object
Returns:
  true, iff both iterable objects contain the same elements.

`def` toList : scala.List[A]

Returns:
  a list with all the elements of this iterable object