PagedSeq

class PagedSeq[T] extends AbstractSeq[T] with IndexedSeq[T] with ScalaVersionSpecificPagedSeq[T]

An implementation of lazily computed sequences, where elements are stored in "pages", i.e. arrays of fixed size.

A paged sequence is constructed from a function that produces more elements when asked. The producer function - more, is similar to the read method in java.io.Reader. The more function takes three parameters: an array of elements, a start index, and an end index. It should try to fill the array between start and end indices (excluding end index). It returns the number of elements produced, or -1 if end of logical input stream was reached before reading any element.

Type parameters:
T

the type of the elements contained in this paged sequence, with an ClassTag context bound.

Companion:
object
trait ScalaVersionSpecificPagedSeq[T]
trait IndexedSeq[T]
class AbstractSeq[T]
trait Seq[T]
trait Equals
trait Int => T
trait Iterable[T]
trait IterableOnce[T]
class Object
trait Matchable
class Any

Value members

Constructors

def this(more: (Array[T], Int, Int) => Int)

Concrete methods

def apply(index: Int): T

The element at position index.

The element at position index.

override def isDefinedAt(index: Int): Boolean

Predicate method to check if an element is defined at position index of the current sequence. Unlike length this operation does not force reading a lazy sequence to the end.

Predicate method to check if an element is defined at position index of the current sequence. Unlike length this operation does not force reading a lazy sequence to the end.

Definition Classes
def length: Int

The length of the paged sequence

The length of the paged sequence

Note:

Calling this method will force the entire sequence to be read.

override def slice(_start: Int, _end: Int): PagedSeq[T]

The subsequence from index start up to end -1 if end is lesser than the length of the current sequence and up to length of the sequence otherwise. This is limited up to the length of the current sequence if end is larger than its length.

The subsequence from index start up to end -1 if end is lesser than the length of the current sequence and up to length of the sequence otherwise. This is limited up to the length of the current sequence if end is larger than its length.

Definition Classes
def slice(start: Int): PagedSeq[T]

The subsequence from index start up to the length of the current sequence.

The subsequence from index start up to the length of the current sequence.

override def toString: String

Convert sequence to string

Convert sequence to string

Definition Classes
Seq -> Function1 -> Iterable -> Any

Inherited methods

final def ++[B >: T](suffix: IterableOnce[B]): IndexedSeq[B]
Inherited from:
IterableOps
final override def ++:[B >: T](prefix: IterableOnce[B]): IndexedSeq[B]
Definition Classes
Inherited from:
SeqOps
final def +:[B >: T](elem: B): IndexedSeq[B]
Inherited from:
SeqOps
final def :+[B >: T](elem: B): IndexedSeq[B]
Inherited from:
SeqOps
final def :++[B >: T](suffix: IterableOnce[B]): IndexedSeq[B]
Inherited from:
SeqOps
Inherited from:
IterableOnceOps
Inherited from:
PartialFunction
override def andThen[C](k: T => C): PartialFunction[Int, C]
Definition Classes
Inherited from:
PartialFunction
def appended[B >: T](elem: B): IndexedSeq[B]
Inherited from:
SeqOps
def appendedAll[B >: T](suffix: IterableOnce[B]): IndexedSeq[B]
Inherited from:
SeqOps
def applyOrElse[A1 <: Int, B1 >: T](x: A1, default: A1 => B1): B1
Inherited from:
PartialFunction
def canEqual(that: Any): Boolean
Inherited from:
Seq
def collect[B](pf: PartialFunction[T, B]): IndexedSeq[B]
Inherited from:
IterableOps
def collectFirst[B](pf: PartialFunction[T, B]): Option[B]
Inherited from:
IterableOnceOps
Inherited from:
SeqOps
Inherited from:
PartialFunction
def compose[A](g: A => Int): A => T
Inherited from:
Function1
final override def concat[B >: T](suffix: IterableOnce[B]): IndexedSeq[B]
Definition Classes
Inherited from:
SeqOps
def contains[A1 >: T](elem: A1): Boolean
Inherited from:
SeqOps
def containsSlice[B >: T](that: Seq[B]): Boolean
Inherited from:
SeqOps
def copyToArray[B >: T](xs: Array[B], start: Int, len: Int): Int
Inherited from:
IterableOnceOps
@deprecatedOverriding(message = "This should always forward to the 3-arg version of this method", since = "2.13.4")
def copyToArray[B >: T](xs: Array[B], start: Int): Int
Inherited from:
IterableOnceOps
@deprecatedOverriding(message = "This should always forward to the 3-arg version of this method", since = "2.13.4")
def copyToArray[B >: T](xs: Array[B]): Int
Inherited from:
IterableOnceOps
def corresponds[B](that: IterableOnce[B])(p: (T, B) => Boolean): Boolean
Inherited from:
IterableOnceOps
def corresponds[B](that: Seq[B])(p: (T, B) => Boolean): Boolean
Inherited from:
SeqOps
def count(p: T => Boolean): Int
Inherited from:
IterableOnceOps
def diff[B >: T](that: Seq[B]): IndexedSeq[T]
Inherited from:
SeqOps
Inherited from:
SeqOps
def distinctBy[B](f: T => B): IndexedSeq[T]
Inherited from:
SeqOps
override def drop(n: Int): IndexedSeq[T]
Definition Classes
Inherited from:
IndexedSeqOps
override def dropRight(n: Int): IndexedSeq[T]
Definition Classes
Inherited from:
IndexedSeqOps
def dropWhile(p: T => Boolean): IndexedSeq[T]
Inherited from:
IterableOps
override def empty: IndexedSeq[T]
def endsWith[B >: T](that: Iterable[B]): Boolean
Inherited from:
SeqOps
override def equals(o: Any): Boolean
Definition Classes
Seq -> Equals -> Any
Inherited from:
Seq
def exists(p: T => Boolean): Boolean
Inherited from:
IterableOnceOps
def filter(pred: T => Boolean): IndexedSeq[T]
Inherited from:
IterableOps
def filterNot(pred: T => Boolean): IndexedSeq[T]
Inherited from:
IterableOps
def find(p: T => Boolean): Option[T]
Inherited from:
IterableOnceOps
def findLast(p: T => Boolean): Option[T]
Inherited from:
SeqOps
def flatMap[B](f: T => IterableOnce[B]): IndexedSeq[B]
Inherited from:
IterableOps
def flatten[B](implicit asIterable: T => IterableOnce[B]): IndexedSeq[B]
Inherited from:
IterableOps
def fold[A1 >: T](z: A1)(op: (A1, A1) => A1): A1
Inherited from:
IterableOnceOps
def foldLeft[B](z: B)(op: (B, T) => B): B
Inherited from:
IterableOnceOps
override def foldRight[B](z: B)(op: (T, B) => B): B
Definition Classes
Inherited from:
IndexedSeqOps
def forall(p: T => Boolean): Boolean
Inherited from:
IterableOnceOps
def foreach[U](f: T => U): Unit
Inherited from:
IterableOnceOps
protected def fromSpecific(coll: IterableOnce[T]): IndexedSeq[T]
def groupBy[K](f: T => K): Map[K, IndexedSeq[T]]
Inherited from:
IterableOps
def groupMap[K, B](key: T => K)(f: T => B): Map[K, IndexedSeq[B]]
Inherited from:
IterableOps
def groupMapReduce[K, B](key: T => K)(f: T => B)(reduce: (B, B) => B): Map[K, B]
Inherited from:
IterableOps
def grouped(size: Int): Iterator[IndexedSeq[T]]
Inherited from:
IterableOps
override def hashCode(): Int
Definition Classes
Seq -> Any
Inherited from:
Seq
override def head: T
Definition Classes
Inherited from:
IndexedSeqOps
override def headOption: Option[T]
Definition Classes
Inherited from:
IndexedSeqOps
@deprecatedOverriding(message = "Override indexOf(elem, from) instead - indexOf(elem) calls indexOf(elem, 0)", since = "2.13.0")
def indexOf[B >: T](elem: B): Int
Inherited from:
SeqOps
def indexOf[B >: T](elem: B, from: Int): Int
Inherited from:
SeqOps
@deprecatedOverriding(message = "Override indexOfSlice(that, from) instead - indexOfSlice(that) calls indexOfSlice(that, 0)", since = "2.13.0")
def indexOfSlice[B >: T](that: Seq[B]): Int
Inherited from:
SeqOps
def indexOfSlice[B >: T](that: Seq[B], from: Int): Int
Inherited from:
SeqOps
@deprecatedOverriding(message = "Override indexWhere(p, from) instead - indexWhere(p) calls indexWhere(p, 0)", since = "2.13.0")
def indexWhere(p: T => Boolean): Int
Inherited from:
SeqOps
def indexWhere(p: T => Boolean, from: Int): Int
Inherited from:
SeqOps
Inherited from:
SeqOps
Inherited from:
IterableOps
Inherited from:
IterableOps
def intersect[B >: T](that: Seq[B]): IndexedSeq[T]
Inherited from:
SeqOps
override def isEmpty: Boolean
Definition Classes
Inherited from:
SeqOps
Definition Classes
Inherited from:
IterableOps
Definition Classes
ScalaVersionSpecificPagedSeq
Inherited from:
ScalaVersionSpecificPagedSeq
Inherited from:
IndexedSeqOps
override def knownSize: Int
Definition Classes
Inherited from:
IndexedSeqOps
override def last: T
Definition Classes
Inherited from:
IndexedSeqOps
def lastIndexOf[B >: T](elem: B, end: Int): Int
Inherited from:
SeqOps
@deprecatedOverriding(message = "Override lastIndexOfSlice(that, end) instead - lastIndexOfSlice(that) calls lastIndexOfSlice(that, Int.MaxValue)", since = "2.13.0")
def lastIndexOfSlice[B >: T](that: Seq[B]): Int
Inherited from:
SeqOps
def lastIndexOfSlice[B >: T](that: Seq[B], end: Int): Int
Inherited from:
SeqOps
@deprecatedOverriding(message = "Override lastIndexWhere(p, end) instead - lastIndexWhere(p) calls lastIndexWhere(p, Int.MaxValue)", since = "2.13.0")
def lastIndexWhere(p: T => Boolean): Int
Inherited from:
SeqOps
def lastIndexWhere(p: T => Boolean, end: Int): Int
Inherited from:
SeqOps
Inherited from:
IterableOps
def lazyZip[B](that: Iterable[B]): LazyZip2[T, B, PagedSeq[T]]
Inherited from:
Iterable
final override def lengthCompare(that: Iterable[_]): Int
Definition Classes
Inherited from:
IndexedSeqOps
final override def lengthCompare(len: Int): Int
Definition Classes
Inherited from:
IndexedSeqOps
Inherited from:
SeqOps
def lift: Int => Option[T]
Inherited from:
PartialFunction
override def map[B](f: T => B): IndexedSeq[B]
Definition Classes
Inherited from:
IndexedSeqOps
def max[B >: T](implicit ord: Ordering[B]): T
Inherited from:
IterableOnceOps
def maxBy[B](f: T => B)(implicit cmp: Ordering[B]): T
Inherited from:
IterableOnceOps
def maxByOption[B](f: T => B)(implicit cmp: Ordering[B]): Option[T]
Inherited from:
IterableOnceOps
def maxOption[B >: T](implicit ord: Ordering[B]): Option[T]
Inherited from:
IterableOnceOps
def min[B >: T](implicit ord: Ordering[B]): T
Inherited from:
IterableOnceOps
def minBy[B](f: T => B)(implicit cmp: Ordering[B]): T
Inherited from:
IterableOnceOps
def minByOption[B](f: T => B)(implicit cmp: Ordering[B]): Option[T]
Inherited from:
IterableOnceOps
def minOption[B >: T](implicit ord: Ordering[B]): Option[T]
Inherited from:
IterableOnceOps
final def mkString: String
Inherited from:
IterableOnceOps
final def mkString(sep: String): String
Inherited from:
IterableOnceOps
final def mkString(start: String, sep: String, end: String): String
Inherited from:
IterableOnceOps
protected def newSpecificBuilder: Builder[T, IndexedSeq[T]]
@deprecatedOverriding(message = "nonEmpty is defined as !isEmpty; override isEmpty instead", since = "2.13.0")
Inherited from:
IterableOnceOps
def orElse[A1 <: Int, B1 >: T](that: PartialFunction[A1, B1]): PartialFunction[A1, B1]
Inherited from:
PartialFunction
def padTo[B >: T](len: Int, elem: B): IndexedSeq[B]
Inherited from:
SeqOps
def partition(p: T => Boolean): (IndexedSeq[T], IndexedSeq[T])
Inherited from:
IterableOps
def partitionMap[A1, A2](f: T => Either[A1, A2]): (IndexedSeq[A1], IndexedSeq[A2])
Inherited from:
IterableOps
def patch[B >: T](from: Int, other: IterableOnce[B], replaced: Int): IndexedSeq[B]
Inherited from:
SeqOps
Inherited from:
SeqOps
override def prepended[B >: T](elem: B): IndexedSeq[B]
Definition Classes
Inherited from:
IndexedSeqOps
def prependedAll[B >: T](prefix: IterableOnce[B]): IndexedSeq[B]
Inherited from:
SeqOps
def product[B >: T](implicit num: Numeric[B]): B
Inherited from:
IterableOnceOps
def reduce[B >: T](op: (B, B) => B): B
Inherited from:
IterableOnceOps
def reduceLeft[B >: T](op: (B, T) => B): B
Inherited from:
IterableOnceOps
def reduceLeftOption[B >: T](op: (B, T) => B): Option[B]
Inherited from:
IterableOnceOps
def reduceOption[B >: T](op: (B, B) => B): Option[B]
Inherited from:
IterableOnceOps
def reduceRight[B >: T](op: (T, B) => B): B
Inherited from:
IterableOnceOps
def reduceRightOption[B >: T](op: (T, B) => B): Option[B]
Inherited from:
IterableOnceOps
override def reverse: IndexedSeq[T]
Definition Classes
Inherited from:
IndexedSeqOps
override def reverseIterator: Iterator[T]
Definition Classes
Inherited from:
IndexedSeqOps
override protected def reversed: Iterable[T]
Definition Classes
Inherited from:
IndexedSeqOps
def runWith[U](action: T => U): Int => Boolean
Inherited from:
PartialFunction
def sameElements[B >: T](that: IterableOnce[B]): Boolean
Inherited from:
SeqOps
Inherited from:
SeqOps
def scan[B >: T](z: B)(op: (B, B) => B): IndexedSeq[B]
Inherited from:
IterableOps
def scanLeft[B](z: B)(op: (B, T) => B): IndexedSeq[B]
Inherited from:
IterableOps
def scanRight[B](z: B)(op: (T, B) => B): IndexedSeq[B]
Inherited from:
IterableOps
override def search[B >: T](elem: B, from: Int, to: Int)(implicit ord: Ordering[B]): SearchResult
Definition Classes
Inherited from:
IndexedSeqOps
override def search[B >: T](elem: B)(implicit ord: Ordering[B]): SearchResult
Definition Classes
Inherited from:
IndexedSeqOps
def segmentLength(p: T => Boolean, from: Int): Int
Inherited from:
SeqOps
final def segmentLength(p: T => Boolean): Int
Inherited from:
SeqOps
final override def size: Int
Definition Classes
Inherited from:
SeqOps
final override def sizeCompare(that: Iterable[_]): Int
Definition Classes
Inherited from:
SeqOps
final override def sizeCompare(otherSize: Int): Int
Definition Classes
Inherited from:
SeqOps
Inherited from:
IterableOps
def sliding(size: Int, step: Int): Iterator[IndexedSeq[T]]
Inherited from:
IterableOps
def sliding(size: Int): Iterator[IndexedSeq[T]]
Inherited from:
IterableOps
def sortBy[B](f: T => B)(implicit ord: Ordering[B]): IndexedSeq[T]
Inherited from:
SeqOps
def sortWith(lt: (T, T) => Boolean): IndexedSeq[T]
Inherited from:
SeqOps
def sorted[B >: T](implicit ord: Ordering[B]): IndexedSeq[T]
Inherited from:
SeqOps
def span(p: T => Boolean): (IndexedSeq[T], IndexedSeq[T])
Inherited from:
IterableOps
override def splitAt(n: Int): (IndexedSeq[T], IndexedSeq[T])
Definition Classes
Inherited from:
IterableOps
def startsWith[B >: T](that: IterableOnce[B], offset: Int): Boolean
Inherited from:
SeqOps
override def stepper[S <: Stepper[_]](implicit shape: StepperShape[T, S]): S & EfficientSplit
Definition Classes
Inherited from:
IndexedSeqOps
def sum[B >: T](implicit num: Numeric[B]): B
Inherited from:
IterableOnceOps
Inherited from:
IterableOps
Inherited from:
IterableOps
override def take(n: Int): IndexedSeq[T]
Definition Classes
Inherited from:
IndexedSeqOps
override def takeRight(n: Int): IndexedSeq[T]
Definition Classes
Inherited from:
IndexedSeqOps
def takeWhile(p: T => Boolean): IndexedSeq[T]
Inherited from:
IterableOps
override def tapEach[U](f: T => U): IndexedSeq[T]
Definition Classes
Inherited from:
IterableOps
def to[C1](factory: Factory[T, C1]): C1
Inherited from:
IterableOnceOps
def toArray[B >: T : ClassTag]: Array[B]
Inherited from:
IterableOnceOps
final def toBuffer[B >: T]: Buffer[B]
Inherited from:
IterableOnceOps
final def toIterable: PagedSeq[T]
Inherited from:
Iterable
def toList: List[T]
Inherited from:
IterableOnceOps
def toMap[K, V](implicit ev: T <:< (K, V)): Map[K, V]
Inherited from:
IterableOnceOps
def toSeq: Seq[T]
Inherited from:
IterableOnceOps
def toSet[B >: T]: Set[B]
Inherited from:
IterableOnceOps
Inherited from:
IterableOnceOps
def transpose[B](implicit asIterable: T => Iterable[B]): IndexedSeq[IndexedSeq[B]]
Inherited from:
IterableOps
def unapply(a: Int): Option[T]
Inherited from:
PartialFunction
def unzip[A1, A2](implicit asPair: T => (A1, A2)): (IndexedSeq[A1], IndexedSeq[A2])
Inherited from:
IterableOps
def unzip3[A1, A2, A3](implicit asTriple: T => (A1, A2, A3)): (IndexedSeq[A1], IndexedSeq[A2], IndexedSeq[A3])
Inherited from:
IterableOps
def updated[B >: T](index: Int, elem: B): IndexedSeq[B]
Inherited from:
SeqOps
override def view: IndexedSeqView[T]
Definition Classes
Inherited from:
IndexedSeqOps
Inherited from:
IterableOps
def zip[B](that: IterableOnce[B]): IndexedSeq[(T, B)]
Inherited from:
IterableOps
def zipAll[A1 >: T, B](that: Iterable[B], thisElem: A1, thatElem: B): IndexedSeq[(A1, B)]
Inherited from:
IterableOps
Inherited from:
IterableOps

Deprecated and Inherited methods

@inline @deprecated(message = "Use foldLeft instead of /:", since = "2.13.0")
final def /:[B](z: B)(op: (B, T) => B): B
Deprecated
[Since version 2.13.0] Use foldLeft instead of /:
Inherited from:
IterableOnceOps
@inline @deprecated(message = "Use foldRight instead of :\\", since = "2.13.0")
final def :\[B](z: B)(op: (T, B) => B): B
Deprecated
[Since version 2.13.0] Use foldRight instead of :\\
Inherited from:
IterableOnceOps
@deprecated(message = "`aggregate` is not relevant for sequential collections. Use `foldLeft(z)(seqop)` instead.", since = "2.13.0")
def aggregate[B](z: => B)(seqop: (B, T) => B, combop: (B, B) => B): B
Deprecated
[Since version 2.13.0] `aggregate` is not relevant for sequential collections. Use `foldLeft(z)(seqop)` instead.
Inherited from:
IterableOnceOps
@inline @deprecatedOverriding(message = "Use iterableFactory instead", since = "2.13.0") @deprecated(message = "Use iterableFactory instead", since = "2.13.0")
Deprecated
[Since version 2.13.0] Use iterableFactory instead
Inherited from:
IterableOps
@inline @deprecated(message = "Use `dest ++= coll` instead", since = "2.13.0")
final def copyToBuffer[B >: T](dest: Buffer[B]): Unit
Deprecated
[Since version 2.13.0] Use `dest ++= coll` instead
Inherited from:
IterableOnceOps
@deprecated(message = "Check .knownSize instead of .hasDefiniteSize for more actionable information (see scaladoc for details)", since = "2.13.0")
Deprecated
[Since version 2.13.0] Check .knownSize instead of .hasDefiniteSize for more actionable information (see scaladoc for details)
Inherited from:
IterableOnceOps
@inline @deprecated(message = "Use segmentLength instead of prefixLength", since = "2.13.0")
final def prefixLength(p: T => Boolean): Int
Deprecated
[Since version 2.13.0] Use segmentLength instead of prefixLength
Inherited from:
SeqOps
@deprecated(message = "Use coll instead of repr in a collection implementation, use the collection value itself from the outside", since = "2.13.0")
final def repr: IndexedSeq[T]
Deprecated
[Since version 2.13.0] Use coll instead of repr in a collection implementation, use the collection value itself from the outside
Inherited from:
IterableOps
@deprecated(message = "Use .reverseIterator.map(f).to(...) instead of .reverseMap(f)", since = "2.13.0")
def reverseMap[B](f: T => B): IndexedSeq[B]
Deprecated
[Since version 2.13.0] Use .reverseIterator.map(f).to(...) instead of .reverseMap(f)
Inherited from:
SeqOps
@deprecated(message = "Iterable.seq always returns the iterable itself", since = "2.13.0")
def seq: PagedSeq[T]
Deprecated
[Since version 2.13.0] Iterable.seq always returns the iterable itself
Inherited from:
Iterable
@inline @deprecated(message = "Use .iterator instead of .toIterator", since = "2.13.0")
final def toIterator: Iterator[T]
Deprecated
[Since version 2.13.0] Use .iterator instead of .toIterator
Inherited from:
IterableOnceOps
@inline @deprecated(message = "Use .to(LazyList) instead of .toStream", since = "2.13.0")
final def toStream: Stream[T]
Deprecated
[Since version 2.13.0] Use .to(LazyList) instead of .toStream
Inherited from:
IterableOnceOps
@deprecated(message = "Use toIterable instead", since = "2.13.0")
final def toTraversable: Iterable[T]
Deprecated
[Since version 2.13.0] Use toIterable instead
Inherited from:
IterableOps
@inline @deprecated(message = "Use `concat` instead", since = "2.13.0")
final def union[B >: T](that: Seq[B]): IndexedSeq[B]
Deprecated
[Since version 2.13.0] Use `concat` instead
Inherited from:
SeqOps
@deprecated(message = "Use .view.slice(from, until) instead of .view(from, until)", since = "2.13.0")
override def view(from: Int, until: Int): IndexedSeqView[T]
Deprecated
[Since version 2.13.0] Use .view.slice(from, until) instead of .view(from, until)
Definition Classes
Inherited from:
IndexedSeqOps