scala.collection.mutable
trait MutableList

[source: `scala/collection/mutable/MutableList.scala`]

`` `trait` MutableList[A]
  `extends` Seq[A]

  This class is used internally to represent mutable lists. It is the basis for the implementation of the classes `Buffer`, `Stack`, and `Queue`.

Author
  Matthias Zenger
Version
  1.0, 08/07/2003

Direct Known Subclasses:
  Queue, Stack

Value Summary
`protected var` | first0 : LinkedList[A]
`protected var` | last0 : LinkedList[A]
`protected var` | len : Int

Method Summary
`protected def` | appendElem (elem : A) : Unit
`def` | apply (n : Int) : A Returns the `n`th element of this list. This method yields an error if the element does not exist.
`override def` | elements : Iterator[A] Returns an iterator over all elements of this list.
`def` | get (n : Int) : Option[A] Returns the `n`th element of this list or `None` if this element does not exist.
`override def` | last : A Returns the last element of this list.
`def` | length : Int Returns the length of this list.
`protected def` | prependElem (elem : A) : Unit
`protected def` | reset : Unit
`protected override def` | stringPrefix : String Defines the prefix of this object's `toString` representation.
`override def` | toList : List[A] Returns an instance of `scala.List` containing the same sequence of elements.

Methods inherited from Seq
size, isEmpty, concat, ++, isDefinedAt, lastIndexOf, map, flatMap, filter, take, drop, takeWhile, dropWhile, reverse, contains, slice, subseq, toArray, projection

Methods inherited from Collection
toString, equalWith

Methods inherited from Iterable
foreach, forall, exists, find, findIndexOf, indexOf, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, copyToBuffer, sameElements, mkString, mkString, 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

`protected` `var` first0 : LinkedList[A]

`protected` `var` last0 : LinkedList[A]

`protected` `var` len : Int

Method Details

`` `def` length : Int

  Returns the length of this list.

Overrides
  Seq.length

`` `def` apply(n : Int) : A

  Returns the `n`th element of this list. This method yields an error if the element does not exist.

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

  Returns the `n`th element of this list or `None` if this element does not exist.

`protected` `def` prependElem(elem : A) : Unit

`protected` `def` appendElem(elem : A) : Unit

`protected` `def` reset : Unit

`override` `def` elements : Iterator[A]

  Returns an iterator over all elements of this list.

`override` `def` last : A

  Returns the last element of this list.

Returns
  the last element of the list.
Throws
  Predef.UnsupportedOperationException - if the list is empty.

Overrides
  Seq.last

`override` `def` toList : List[A]

  Returns an instance of `scala.List` containing the same sequence of elements.

`protected override` `def` stringPrefix : String

  Defines the prefix of this object's `toString` representation.