scala.collection.mutable

trait IndexedSeqView

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

trait IndexedSeqView[A, +Coll]
extends IndexedSeqView[A, Coll] with AnyRef
A non-strict view of a mutable IndexedSeq. This is a leaf class which mixes methods returning a plain IndexedSeq view and methods returning a mutable IndexedSeq view. There is no associated `Like' class.
Author
Sean McDirmid
Martin Odersky
Version
2.8
Since
2.8
Direct Known Subclasses:
IndexedSeqView.Transformed

Method Summary
override def drop (n : Int) : IndexedSeqView[A, Coll]
Returns this traversable without its n first elements If this traversable has less than n elements, the empty traversable is returned.
override def dropWhile (p : (A) => Boolean) : IndexedSeqView[A, Coll]
Returns the longest suffix of this traversable whose first element does not satisfy the predicate p.
override def filter (p : (A) => Boolean) : IndexedSeqView[A, Coll]
Returns all the elements of this traversable that satisfy the predicate p. The order of the elements is preserved.
override def init : IndexedSeqView[A, Coll]
a traversable consisting of all elements of this traversable except the last one.
protected override def newDroppedWhile (p : (A) => Boolean) : Transformed[A]
protected override def newFiltered (p : (A) => Boolean) : Transformed[A]
Boilerplate method, to override in each subclass This method could be eliminated if Scala had virtual classes
protected override def newReversed : Transformed[A]
protected override def newSliced (_from : Int, _until : Int) : Transformed[A]
protected override def newTakenWhile (p : (A) => Boolean) : Transformed[A]
override def reverse : IndexedSeqView[A, Coll]
A sequence of type C consisting of all elements of this sequence in reverse order.
override def slice (from : Int, until : Int) : IndexedSeqView[A, Coll]
A sub-iterable starting at index `from` and extending up to (but not including) index `until`.
override def span (p : (A) => Boolean) : (IndexedSeqView[A, Coll], IndexedSeqView[A, Coll])
Returns a pair consisting of the longest prefix of the traversable whose elements all satisfy the given predicate, and the rest of the traversable.
override def splitAt (n : Int) : (IndexedSeqView[A, Coll], IndexedSeqView[A, Coll])
Split the traversable at a given point and return the two parts thus created.
override def take (n : Int) : IndexedSeqView[A, Coll]
Return an iterable consisting only of the first n elements of this iterable, or else the whole iterable, if it has less than n elements.
override def takeWhile (p : (A) => Boolean) : IndexedSeqView[A, Coll]
Returns the longest prefix of this iterable whose elements satisfy the predicate p.
abstract def update (idx : Int, elem : A) : Unit
Methods inherited from IndexedSeqViewLike
newAppended, newMapped, newFlatMapped, newZipped, newZippedAll, newPatched, stringPrefix
Methods inherited from SeqViewLike
patch, padTo
Methods inherited from IterableViewLike
zip, zipWithIndex, zipAll
Methods inherited from TraversableViewLike
underlying (abstract), newBuilder, force, ++, ++, map, flatMap
Methods inherited from IndexedSeq
companion
Methods inherited from IndexedSeqLike
thisCollection, toCollection, iterator, isEmpty, foreach, forall, exists, find, foldLeft, foldRight, reduceLeft, reduceRight, head, tail, last, takeRight, dropRight, sameElements, copyToArray, lengthCompare, segmentLength, indexWhere, lastIndexWhere, reverseIterator, startsWith, endsWith, view, view
Methods inherited from SeqLike
length (abstract), apply (abstract), size, isDefinedAt, prefixLength, indexWhere, findIndexOf, indexOf, indexOf, lastIndexOf, lastIndexOf, lastIndexWhere, reverseMap, reversedElements, startsWith, indexOfSeq, indexOfSeq, lastIndexOfSeq, lastIndexOfSeq, contains, union, diff, intersect, removeDuplicates, updated, +:, :+, sortWith, sortWith, sortBy, toSeq, indices, hashCode, equals, toString, findLastIndexOf, equalsWith, containsSlice, projection
Methods inherited from IterableLike
elements, toIterable, toStream, canEqual, first, firstOption
Methods inherited from GenericTraversableTemplate
genericBuilder, unzip, flatten, transpose
Methods inherited from TraversableLike
repr, nonEmpty, hasDefiniteSize, filterNot, partialMap, remove, partition, groupBy, count, /:, :\, reduceLeftOption, reduceRightOption, sum, product, min, max, headOption, lastOption, copyToBuffer, copyToArray, toArray, toList, toIndexedSeq, toSet, mkString, mkString, mkString, addString, addString, addString, withFilter
Methods inherited from PartialFunction
orElse, andThen
Methods inherited from Function1
compose
Methods inherited from AnyRef
getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Class Summary
trait DroppedWhile extends Transformed[A] with DroppedWhile
trait Filtered extends Transformed[A] with Filtered
trait Reversed extends Transformed[A] with Reversed
trait Sliced extends Transformed[A] with Sliced
pre: from >= 0
trait TakenWhile extends Transformed[A] with TakenWhile
trait Transformed [B] extends IndexedSeqView[B, Coll] with Transformed[B]
Method Details
abstract def update(idx : Int, elem : A) : Unit

protected override def newFiltered(p : (A) => Boolean) : Transformed[A]
Boilerplate method, to override in each subclass This method could be eliminated if Scala had virtual classes

protected override def newSliced(_from : Int, _until : Int) : Transformed[A]

protected override def newDroppedWhile(p : (A) => Boolean) : Transformed[A]

protected override def newTakenWhile(p : (A) => Boolean) : Transformed[A]

protected override def newReversed : Transformed[A]

override def filter(p : (A) => Boolean) : IndexedSeqView[A, Coll]
Returns all the elements of this traversable that satisfy the predicate p. The order of the elements is preserved.
Parameters
p - the predicate used to filter the traversable.
Returns
the elements of this traversable satisfying p.

override def init : IndexedSeqView[A, Coll]
a traversable consisting of all elements of this traversable except the last one.
Throws
Predef.UnsupportedOperationException - if the stream is empty.
Notes
Might return different results for different runs, unless this traversable is ordered

override def drop(n : Int) : IndexedSeqView[A, Coll]
Returns this traversable without its n first elements If this traversable has less than n elements, the empty traversable is returned.
Parameters
n - the number of elements to drop
Returns
the new traversable
Notes
Might return different results for different runs, unless this traversable is ordered

override def take(n : Int) : IndexedSeqView[A, Coll]
Return an iterable consisting only of the first n elements of this iterable, or else the whole iterable, if it has less than n elements.
Parameters
n - the number of elements to take
Notes
Might return different results for different runs, unless this iterable is ordered

override def slice(from : Int, until : Int) : IndexedSeqView[A, Coll]
A sub-iterable starting at index `from` and extending up to (but not including) index `until`.
Notes
c.slice(from, to) is equivalent to (but possibly more efficient than) c.drop(from).take(to - from)
Might return different results for different runs, unless this iterable is ordered
Parameters
from - The index of the first element of the returned subsequence
until - The index of the element following the returned subsequence

override def dropWhile(p : (A) => Boolean) : IndexedSeqView[A, Coll]
Returns the longest suffix of this traversable whose first element does not satisfy the predicate p.
Parameters
p - the test predicate.
Notes
Might return different results for different runs, unless this traversable is ordered

override def takeWhile(p : (A) => Boolean) : IndexedSeqView[A, Coll]
Returns the longest prefix of this iterable whose elements satisfy the predicate p.
Parameters
p - the test predicate.
Notes
Might return different results for different runs, unless this iterable is ordered

override def span(p : (A) => Boolean) : (IndexedSeqView[A, Coll], IndexedSeqView[A, Coll])
Returns a pair consisting of the longest prefix of the traversable whose elements all satisfy the given predicate, and the rest of the traversable.
Parameters
p - the test predicate
Returns
a pair consisting of the longest prefix of the traversable whose elements all satisfy p, and the rest of the traversable.
Notes
Might return different results for different runs, unless this traversable is ordered

override def splitAt(n : Int) : (IndexedSeqView[A, Coll], IndexedSeqView[A, Coll])
Split the traversable at a given point and return the two parts thus created.
Parameters
n - the position at which to split
Returns
a pair of traversables composed of the first n elements, and the other elements.
Notes
Might return different results for different runs, unless this traversable is ordered

override def reverse : IndexedSeqView[A, Coll]
A sequence of type C consisting of all elements of this sequence in reverse order.