scala.collection.mutable

class SingleLinkedList

[source: scala/collection/mutable/SingleLinkedList.scala]

abstract class SingleLinkedList[A, This <: SingleLinkedList[A, This] >: Null]
extends Seq[A]
This extensible class may be used as a basis for implementing linked list. Type variable A refers to the element type of the list, type variable This is used to model self types of linked lists.
Author
Matthias Zenger
Version
1.0, 08/07/2003
Direct Known Subclasses:
DoubleLinkedList, LinkedList

Value Summary
abstract var elem : A
abstract var next : This
Method Summary
def append (that : This) : Unit
def apply (n : Int) : A
def elements : Iterator[A]
Creates a new iterator over all elements contained in this object.
def get (n : Int) : Option[A]
def insert (that : This) : Unit
def length : Int
Returns the length of the sequence.
override def toList : List[A]
Create a fresh list with all the elements of this iterable object.
Methods inherited from Seq
size, isEmpty, concat, ++, isDefinedAt, lastIndexOf, map, flatMap, filter, take, drop, takeWhile, dropWhile, reverse, contains, slice, subseq, toArray
Methods inherited from Collection
toString, stringPrefix
Methods inherited from Iterable
foreach, forall, exists, find, findIndexOf, indexOf, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, copyToBuffer, sameElements, mkString, mkString, addString, addString, copyToArray, projection, hasDefiniteSize
Methods inherited from PartialFunction
orElse, andThen
Methods inherited from Function1
compose
Methods inherited from AnyRef
getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Value Details
abstract var elem : A

abstract var next : This

Method Details
def length : Int
Returns the length of the sequence.
Returns
the sequence length.
Overrides
Seq.length

def append(that : This) : Unit

def insert(that : This) : Unit

def apply(n : Int) : A

def get(n : Int) : Option[A]

def elements : Iterator[A]
Creates a new iterator over all elements contained in this object.
Returns
the new iterator

override def toList : List[A]
Create a fresh list with all the elements of this iterable object.
Notes
Will not terminate for infinite-sized collections.