Scala Library
|
|
class
MutableList[A]
extends
LinearSequence[A] with
LinearSequenceTemplate[A, MutableList[A]] with
Builder[A, MutableList[A]]Stack
, and Queue
.
!!! todo: convert to LinkedListBuffer?Value Summary | |
protected var
|
first0 : LinkedList[A] |
protected var
|
last0 : LinkedList[A] |
protected var
|
len : Int |
Method Summary | |
def
|
+=
(elem : A) : MutableList[A]
Appends a single element to this buffer. This takes constant time.
|
protected def
|
appendElem (elem : A) : Unit |
override def
|
apply
(n : Int) : A
Returns the
n th element of this list. |
def
|
clear
: Unit
Clear the contents of this builder
|
def
|
get
(n : Int) : Option[A]
Returns the
n th element of this list or None
if index does not exist. |
override def
|
head
: A
Returns the first element in this list
|
override def
|
isEmpty
: Boolean
Is the list empty?
|
override def
|
iterator
: Iterator[A]
Returns an iterator over all elements of this list.
|
override def
|
last
: A
The last element of this linear sequence.
|
override def
|
length
: Int
Returns the length of this list.
|
protected[this] override def
|
newBuilder
: MutableList[A]
The builder that builds instances of CC[A]
|
protected def
|
prependElem (elem : A) : Unit |
def
|
reset : Unit |
def
|
result
: MutableList[A]
Returns collection resulting from this builder. The buffer's contents
are undefined afterwards.
|
override def
|
tail
: MutableList[A]
Returns the rest of this list
|
override def
|
toList
: List[A]
Returns an instance of
scala.List containing the same
sequence of elements. |
def
|
update
(n : Int, x : A) : Unit
Updates the
n th element of this list to a new value. |
Methods inherited from Builder | |
sizeHint, mapResult |
Methods inherited from Growable | |
+=, ++=, ++= |
Methods inherited from LinearSequence | |
companion |
Methods inherited from LinearSequenceTemplate | |
foreach, forall, exists, count, find, foldLeft, foldRight, reduceLeft, reduceRight, take, drop, dropRight, span, sameElements, lengthCompare, isDefinedAt, segmentLength, indexWhere, lastIndexWhere, equals |
Methods inherited from Unhashable | |
hashCode, identityHashCode |
Methods inherited from SequenceTemplate | |
size, zip, zipAll, zipWithIndex, prefixLength, indexWhere, findIndexOf, indexOf, indexOf, lastIndexOf, lastIndexOf, lastIndexWhere, reverse, reverseIterator, reversedElements, startsWith, startsWith, endsWith, indexOfSeq, indexOfSeq, lastIndexOfSeq, lastIndexOfSeq, contains, union, diff, intersect, removeDuplicates, patch, padTo, toSequence, indices, view, view, toString, sortWith, findLastIndexOf, slice, equalsWith, containsSlice, projection |
Methods inherited from PartialFunction | |
orElse, andThen |
Methods inherited from Function1 | |
compose |
Methods inherited from IterableTemplate | |
elements, toIterable, takeRight, toStream, first, firstOption, toSeq |
Methods inherited from TraversableClass | |
genericBuilder, unzip, flatten, transpose |
Methods inherited from TraversableTemplate | |
thisCollection, nonEmpty, hasDefiniteSize, ++, ++, map, flatMap, filter, filterMap, filterNot, remove, partition, groupBy, /:, :\, reduceLeftOption, reduceRightOption, headOption, lastOption, init, slice, takeWhile, dropWhile, splitAt, copyToBuffer, copyToArray, copyToArray, toArray, toSet, mkString, mkString, mkString, addString, addString, addString, stringPrefix |
Methods inherited from AnyRef | |
getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
Value Details |
Method Details |
protected[this] override
def
newBuilder : MutableList[A]
override
def
isEmpty : Boolean
override
def
head : A
override
def
tail : MutableList[A]
override
def
length : Int
n
th element of this list.IndexOutofBoundsException -
if index does not exist.n
th element of this list to a new value.IndexOutofBoundsException -
if index does not exist.n
th element of this list or None
if index does not exist.
def
reset : Unit
override
def
last : A
scala.List
containing the same
sequence of elements.
def
+=(elem : A) : MutableList[A]
elem -
the element to append.
def
clear : Unit
def
result : MutableList[A]
Scala Library
|
|