scala

trait RandomAccessSeqProxy

[source: scala/RandomAccessSeqProxy.scala]

trait RandomAccessSeqProxy[+A]
extends RandomAccessSeq[A] with SeqProxy[A]
This class implements a proxy for random access sequences. It forwards all calls to a different sequence object.
Author
Stepan Koltsov
Version
1.0, 27/06/2008
Direct Known Subclasses:
PriorityQueueProxy

Method Summary
override def ++ [B >: A](that : Iterable[B]) : RandomAccessSeq[B]
Appends two iterable objects.
override def drop (from : Int) : RandomAccessSeq[A]
Returns this sequence without its n first elements If this sequence has less than n elements, the empty sequence is returned. (non-strict)
override def partition (p : (A) => Boolean) : (RandomAccessSeq[A], RandomAccessSeq[A])
Partitions this random access sequence in two random access sequences according to a predicate.
override def patch [B >: A](from0 : Int, patch0 : RandomAccessSeq[B], replaced0 : Int) : Projection[B]
insert segment patch into this sequence at from replacing replaced elements. The result is a projection.
override def projection : Projection[A]
returns a projection that can be used to call non-strict filter, map, and flatMap methods that build projections of the collection.
override def reverse : Seq[A]
A sequence consisting of all elements of this sequence in reverse order.
override abstract def self : RandomAccessSeq[A]
override def slice (from : Int, until : Int) : RandomAccessSeq[A]
A sub-sequence starting at index from and ending (non-inclusive) at index until (non-strict)
override def take (until : Int) : RandomAccessSeq[A]
Returns a sequence consisting only over the first n elements of this sequence, or else the whole sequence, if it has less than n elements. (non-strict)
override def toStream : Stream[A]
Returns a stream containing all of the elements in this iterable object.
Methods inherited from SeqProxy
apply, length, lengthCompare, size, isEmpty, concat, last, lastOption, first, firstOption, headOption, isDefinedAt, lastIndexOf, findIndexOf, indexOf, map, flatMap, filter, slice, takeWhile, dropWhile, contains, subseq, toArray, toSeq, equalsWith, startsWith, endsWith, indexOf, containsSlice
Methods inherited from IterableProxy
elements, foreach, forall, exists, find, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, copyToBuffer, sameElements, toList, mkString, mkString, mkString, addString, addString, addString, copyToArray, hasDefiniteSize
Methods inherited from Proxy
hashCode, equals, toString
Methods inherited from RandomAccessSeq
safeIs
Methods inherited from Seq
startsWith
Methods inherited from Collection
stringPrefix
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
Method Details
override abstract def self : RandomAccessSeq[A]
Overrides
SeqProxy.self

override def projection : Projection[A]
returns a projection that can be used to call non-strict filter, map, and flatMap methods that build projections of the collection.
Overrides
RandomAccessSeq.projection, SeqProxy.projection

override def drop(from : Int) : RandomAccessSeq[A]
Returns this sequence without its n first elements If this sequence has less than n elements, the empty sequence is returned. (non-strict)
Parameters
n - the number of elements to drop
Returns
the new sequence
Overrides
RandomAccessSeq.drop, SeqProxy.drop

override def take(until : Int) : RandomAccessSeq[A]
Returns a sequence consisting only over the first n elements of this sequence, or else the whole sequence, if it has less than n elements. (non-strict)
Parameters
n - the number of elements to take
Returns
a possibly projected sequence
Overrides
RandomAccessSeq.take, SeqProxy.take

override def slice(from : Int, until : Int) : RandomAccessSeq[A]
A sub-sequence starting at index from and ending (non-inclusive) at index until (non-strict)
Parameters
from - The index of the first element of the slice
until - The index of the element following the slice
Throws
IndexOutOfBoundsException - if from < 0 or length < from + len
Overrides
RandomAccessSeq.slice, SeqProxy.slice

override def reverse : Seq[A]
A sequence consisting of all elements of this sequence in reverse order.
Overrides
RandomAccessSeq.reverse, SeqProxy.reverse

override def partition(p : (A) => Boolean) : (RandomAccessSeq[A], RandomAccessSeq[A])
Partitions this random access sequence in two random access sequences according to a predicate.
Parameters
p - the predicate on which to partition
Returns
a pair of random access sequences: the sequence of all elements that satisfy the predicate p and the sequence of all elements that do not. The relative order of the elements in the resulting sequences is the same as in the original sequence.
Overrides
RandomAccessSeq.partition

override def patch[B >: A](from0 : Int, patch0 : RandomAccessSeq[B], replaced0 : Int) : Projection[B]
insert segment patch into this sequence at from replacing replaced elements. The result is a projection.
Overrides
RandomAccessSeq.patch

override def ++[B >: A](that : Iterable[B]) : RandomAccessSeq[B]
Appends two iterable objects.
Overrides
RandomAccessSeq.++, SeqProxy.++

override def toStream : Stream[A]
Returns a stream containing all of the elements in this iterable object.
Notes
consider using projection for lazy behavior.
Overrides
RandomAccessSeq.toStream