Scala Library
|
|
scala/collection/immutable/Vector.scala
]
final
class
Vector[+A](startIndex : Int, endIndex : Int, focus : Int)
extends
Seq[A] with
GenericTraversableTemplate[A, Vector] with
SeqLike[A, Vector[A]] with
scala.collection.immutable.VectorPointer[A]Value Summary | |
var
|
dirty : Boolean |
Method Summary | |
override def
|
+:
[B >: A, That](elem : B)(implicit bf : CanBuildFrom[Vector[A], B, That]) : That
Returns a new sequence consisting of `elem` followed by the elements of this sequence.
|
override def
|
:+
[B >: A, That](elem : B)(implicit bf : CanBuildFrom[Vector[A], B, That]) : That
Returns a new sequence consisting of the elements of this sequence followed by `elem`.
|
def
|
appendBack [B >: A](value : B) : Vector[B] |
def
|
appendFront [B >: A](value : B) : Vector[B] |
def
|
apply
(index : Int) : A
Returns the elements at position `idx`
|
override def
|
companion
: GenericCompanion[Vector]
The factory companion object that builds instances of class CC
|
def
|
copyLeft (array : Array[AnyRef], right : Int) : Array[AnyRef] |
def
|
copyRight (array : Array[AnyRef], left : Int) : Array[AnyRef] |
override def
|
drop
(n : Int) : Vector[A]
Returns this traversable without its
n first elements
If this traversable has less than n elements, the empty
traversable is returned. |
override def
|
dropRight
(n : Int) : Vector[A]
Returns the iterable wihtout its rightmost
n elements. |
def
|
foreach0 [U](f : (A) => U) : Unit |
override def
|
iterator
: VectorIterator[A]
Creates a new iterator over all elements contained in this
iterable object.
|
def
|
length
: Int
Returns the length of the sequence.
|
override def
|
lengthCompare
(len : Int) : Int
Result of comparing
length with operand len .
returns x where
x < 0 iff this.length < len
x == 0 iff this.length == len
x > 0 iff this.length > len .
The method as implemented here does not call length directly; its running time
is O(length min len) instead of O(length). The method should be overwritten
if computing length is cheap. |
def
|
map0
[B, That](f : (A) => B)(implicit bf : CanBuildFrom[Vector[A], B, That]) : That
|
override def
|
take
(n : Int) : Vector[A]
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
|
takeRight
(n : Int) : Vector[A]
Returns the rightmost
n elements from this iterable. |
def
|
updateAt [B >: A](index : Int, elem : B) : Vector[B] |
override def
|
updated
[B >: A, That](index : Int, elem : B)(implicit bf : CanBuildFrom[Vector[A], B, That]) : That
Returns a copy of this sequence with the element at position `index` replaced by `elem`.
|
def
|
zeroLeft (array : Array[AnyRef], index : Int) : Unit |
def
|
zeroRight (array : Array[AnyRef], index : Int) : Unit |
Methods inherited from SeqLike | |
thisCollection, toCollection, size, isDefinedAt, segmentLength, prefixLength, indexWhere, indexWhere, findIndexOf, indexOf, indexOf, lastIndexOf, lastIndexOf, lastIndexWhere, lastIndexWhere, reverse, reverseMap, reverseIterator, reversedElements, startsWith, startsWith, endsWith, indexOfSeq, indexOfSeq, lastIndexOfSeq, lastIndexOfSeq, contains, union, diff, intersect, removeDuplicates, patch, padTo, sortWith, sortWith, sortBy, toSeq, indices, view, view, hashCode, equals, toString, findLastIndexOf, equalsWith, containsSlice, projection |
Methods inherited from PartialFunction | |
orElse, andThen |
Methods inherited from Function1 | |
compose |
Methods inherited from IterableLike | |
elements, foreach, forall, exists, find, isEmpty, foldRight, reduceRight, toIterable, head, slice, takeWhile, copyToArray, zip, zipAll, zipWithIndex, sameElements, toStream, canEqual, first, firstOption |
Methods inherited from GenericTraversableTemplate | |
newBuilder, genericBuilder, unzip, flatten, transpose |
Methods inherited from TraversableLike | |
repr, nonEmpty, hasDefiniteSize, ++, ++, map, flatMap, filter, filterNot, partialMap, remove, partition, groupBy, count, foldLeft, /:, :\, reduceLeft, reduceLeftOption, reduceRightOption, sum, product, min, max, headOption, tail, last, lastOption, init, dropWhile, span, splitAt, copyToBuffer, copyToArray, toArray, toList, toIndexedSeq, toSet, mkString, mkString, mkString, addString, addString, addString, stringPrefix, withFilter |
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 |
override
def
companion : GenericCompanion[Vector]
def
length : Int
length
with operand len
.
returns x
where
x < 0
iff this.length < len
x == 0
iff this.length == len
x > 0
iff this.length > len
.
The method as implemented here does not call length directly; its running time
is O(length min len) instead of O(length). The method should be overwritten
if computing length is cheap.override
def
iterator : VectorIterator[A]
override
def
updated[B >: A, That](index : Int, elem : B)(implicit
bf : CanBuildFrom[Vector[A], B, That]) : That
override
def
+:[B >: A, That](elem : B)(implicit
bf : CanBuildFrom[Vector[A], B, That]) : That
override
def
:+[B >: A, That](elem : B)(implicit
bf : CanBuildFrom[Vector[A], B, That]) : That
n
elements of this iterable, or else the whole iterable, if it has less
than n
elements.n -
the number of elements to taken
first elements
If this traversable has less than n
elements, the empty
traversable is returned.n -
the number of elements to dropn
elements from this iterable.n -
the number of elements to taken
elements.n -
the number of elements to take
Scala Library
|
|