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
override 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]
Returns a list containing all of the elements in this iterable object.
Methods inherited from Seq
lengthCompare, size, isEmpty, concat, last, lastOption, first, firstOption, headOption, ++, isDefinedAt, lastIndexOf, findIndexOf, indexOf, map, flatMap, filter, take, drop, slice, slice, takeWhile, dropWhile, reverse, contains, subseq, toArray, toSeq, projection, equalsWith, startsWith, startsWith, endsWith, indexOf, containsSlice
Methods inherited from Collection
toString, stringPrefix
Methods inherited from Iterable
partition, foreach, forall, exists, find, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, copyToBuffer, sameElements, toStream, mkString, mkString, mkString, addString, addString, addString, copyToArray, 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]

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

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