summaryrefslogtreecommitdiff
path: root/src/library/scala/RandomAccessSeqProxy.scala
blob: a5fb245f975b0aeac95a6f857b8a7a19d50616ec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*                     __                                               *\
**     ________ ___   / /  ___     Scala API                            **
**    / __/ __// _ | / /  / _ |    (c) 2003-2008, LAMP/EPFL             **
**  __\ \/ /__/ __ |/ /__/ __ |    http://scala-lang.org/               **
** /____/\___/_/ |_/____/_/ | |                                         **
**                          |/                                          **
\*                                                                      */

// $Id$


package scala

/** 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
 */
trait RandomAccessSeqProxy[+A] extends RandomAccessSeq[A] with SeqProxy[A] {
  override def self: RandomAccessSeq[A]

  override def drop(from: Int): RandomAccessSeq[A] = self.drop(from)
  override def take(until: Int): RandomAccessSeq[A] = self.take(until)
  override def slice(from: Int, until: Int) : RandomAccessSeq[A] = self.slice(from, until)
  override def partition(p: A => Boolean): (RandomAccessSeq[A], RandomAccessSeq[A]) =
    self.partition(p)
  // XXX: def patch, reverse, should not return projection
  override def ++[B >: A](that: Iterable[B]): RandomAccessSeq[B] = self ++ that
  override def toStream: Stream[A] = self.toStream
}

// vim: set ts=2 sw=2 et: