blob: a46e05ee70c6d5eb3125ff45e552f82116d4e648 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2009, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
// $Id$
package scala.collection.generic
import collection.mutable.Buffer
/** This trait implements a forwarder for iterable objects. It forwards
* all calls to a different iterable object, except for
*
* - toString, hashCode, equals, stringPrefix
* - newBuilder, view
* - all calls creating a new iterable objetc of the same kind
*
* The above methods are forwarded by subclass IterableProxy
*
* @author Martin Odersky
* @version 2.8
*/
trait IterableForwarder[+A] extends Iterable[A] with TraversableForwarder[A] {
/** The iterable object to which calls are forwarded */
protected def underlying: Iterable[A]
// Iterable delegates
// Iterable methods could be printed by cat IterableTemplate.scala | sed -n '/trait Iterable/,$ p' | egrep '^ (override )?def'
override def iterator = underlying.iterator
override def sameElements[B >: A](that: Iterable[B]): Boolean = underlying.sameElements(that)
}
|