blob: 1c67e3a41325c19b907ae08303aa576bf369fd13 (
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
|
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2009, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
// $Id$
package scala.collection.mutable
import generic._
/** This class implements single linked lists where both the head (<code>elem</code>)
* and the tail (<code>next</code>) are mutable.
*
* @author Matthias Zenger
* @author Martin Odersky
* @version 2.8
*/
@serializable
class DoubleLinkedList[A]/*(_elem: A, _next: DoubleLinkedList[A])*/ extends LinearSequence[A] with DoubleLinkedListTemplate[A, DoubleLinkedList[A]] {
override protected[this] def newBuilder = DoubleLinkedList.newBuilder
override def traversableBuilder[B]: Builder[B, DoubleLinkedList[B]] = DoubleLinkedList.newBuilder[B]
}
object DoubleLinkedList extends SequenceFactory[DoubleLinkedList] {
type Coll = DoubleLinkedList[_]
implicit def builderFactory[A]: BuilderFactory[A, DoubleLinkedList[A], Coll] = new BuilderFactory[A, DoubleLinkedList[A], Coll] { def apply(from: Coll) = from.traversableBuilder[A] }
def newBuilder[A]: Builder[A, DoubleLinkedList[A]] = null // !!!
}
|