in scala/collection/mutable
class SingleLinkedList

abstract class SingleLinkedList[A,This<:SingleLinkedList[A,This]]()
extends Object
with ScalaObject
with Seq[A]
Implementing classes or objects:
class LinkedList[A](head: A, tail: LinkedList[A])
class DoubleLinkedList[A,This<:DoubleLinkedList[A,This]]()

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

Method Summary
  def append(that: This): Unit
  def apply(n: Int): A
  var elem: 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.
  var next: This
override def toList: List[A]
     Transform this sequence into a list of all elements.

Methods inherited from java/lang/Object-class
clone, eq, equals, finalize, getClass, hashCode, ne, notify, notifyAll, synchronized, wait, wait, wait

Methods inherited from scala/Any-class
!=, ==, asInstanceOf, isInstanceOf, match

Methods inherited from scala/Iterable-class
/:, :\, concat, exists, find, foldLeft, foldRight, forall, foreach, sameElements

Methods inherited from scala/ScalaObject-class
getScalaType

Methods inherited from scala/Seq-class
concat, copyToArray, drop, indexOf, isDefinedAt, lastIndexOf, stringPrefix, subseq, take, toString

Method Detail

elem

  var elem: A

next

  var next: This

length

  def length: Int
Returns the length of the sequence.
Returns:
the sequence length.

append

  def append(that: This): Unit

insert

  def insert(that: This): Unit

apply

  def apply(n: Int): A

get

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

elements

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

toList

  override def toList: List[A]
Transform this sequence into a list of all elements.
Returns:
a list which enumerates all elements of this sequence.