ForeachBasedDetachingIterable

scalax.collection.ForeachBasedDetachingIterable

Substitute for Scala 2.12 Traversable to continue support for collections that cannot implement hasNext/next easily. The methods of Scala 2.13's IterableOnce are implemented in terms of foreach.

All methods with a collection result detach from this Iterable to Vector. This makes sense whenever the foreach implementation

  • causes significant computation overhead or
  • is not valid for arbitrary subcollections.

Attributes

Graph
Supertypes
trait Iterable[A]
trait IterableOps[A, Iterable, Iterable[A]]
trait IterableOnce[A]
class Object
trait Matchable
class Any
Show all
Known subtypes

Members list

Value members

Abstract methods

protected def autarkicForeach[U](f: A => U): Unit

Concrete methods

final override def addString(b: StringBuilder, start: String, sep: String, end: String): b.type

Attributes

Definition Classes
final override def collect[B](pf: PartialFunction[A, B]): Iterable[B]

Attributes

Definition Classes
final override def collectFirst[B](pf: PartialFunction[A, B]): Option[B]

Attributes

Definition Classes
final override def count(p: A => Boolean): Int

Attributes

Definition Classes
final override def drop(n: Int): Vector[A]

Attributes

Definition Classes
final override def dropWhile(p: A => Boolean): Vector[A]

Attributes

Definition Classes
final override def exists(p: A => Boolean): Boolean

Attributes

Definition Classes
final override def filter(p: A => Boolean): Vector[A]

Attributes

Definition Classes
final override def filterNot(p: A => Boolean): Vector[A]

Attributes

Definition Classes
final override def find(p: A => Boolean): Option[A]

Attributes

Definition Classes
final override def flatMap[B](f: A => IterableOnce[B]): Iterable[B]

Attributes

Definition Classes
final override def foldLeft[B](z: B)(op: (B, A) => B): B

Attributes

Definition Classes
final override def forall(p: A => Boolean): Boolean

Attributes

Definition Classes
final override def foreach[U](f: A => U): Unit

Attributes

Definition Classes
final override def head: A

Attributes

Definition Classes
final override def headOption: Option[A]

Attributes

Definition Classes
final override def isEmpty: Boolean

Attributes

Definition Classes

Attributes

Definition Classes
def iterator: Iterator[A]
final override def map[B](f: A => B): Iterable[B]

Attributes

Definition Classes
final override def max[B >: A](implicit ord: Ordering[B]): A

Attributes

Definition Classes
final override def maxBy[B](f: A => B)(implicit cmp: Ordering[B]): A

Attributes

Definition Classes
final override def maxByOption[B](f: A => B)(implicit cmp: Ordering[B]): Option[A]

Attributes

Definition Classes
final override def maxOption[B >: A](implicit ord: Ordering[B]): Option[A]

Attributes

Definition Classes
final override def min[B >: A](implicit ord: Ordering[B]): A

Attributes

Definition Classes
final override def minBy[B](f: A => B)(implicit cmp: Ordering[B]): A

Attributes

Definition Classes
final override def minByOption[B](f: A => B)(implicit cmp: Ordering[B]): Option[A]

Attributes

Definition Classes
final override def minOption[B >: A](implicit ord: Ordering[B]): Option[A]

Attributes

Definition Classes
final override def product[B >: A](implicit num: Numeric[B]): B

Attributes

Definition Classes
final override def reduce[B >: A](op: (B, B) => B): B

Attributes

Definition Classes
final override def reduceLeft[B >: A](op: (B, A) => B): B

Attributes

Definition Classes
final override def reduceLeftOption[B >: A](op: (B, A) => B): Option[B]

Attributes

Definition Classes
final override def reduceOption[B >: A](op: (B, B) => B): Option[B]

Attributes

Definition Classes
final override def scanLeft[B](z: B)(op: (B, A) => B): Vector[B]

Attributes

Definition Classes
final override def size: Int

Attributes

Definition Classes
final override def slice(from: Int, until: Int): Vector[A]

Attributes

Definition Classes
final override def span(p: A => Boolean): (Vector[A], Vector[A])

Attributes

Definition Classes
final override def splitAt(n: Int): (Vector[A], Vector[A])

Attributes

Definition Classes
final override def sum[B >: A](implicit num: Numeric[B]): B

Attributes

Definition Classes
final override def take(n: Int): Iterable[A]

Attributes

Definition Classes
final override def takeWhile(p: A => Boolean): Vector[A]

Attributes

Definition Classes
final override def to[C1](factory: Factory[A, C1]): C1

Attributes

Definition Classes
final override def zipWithIndex: Vector[(A, Int)]

Attributes

Definition Classes

Inherited methods

final def ++[B >: A](suffix: IterableOnce[B]): Iterable[B]

Attributes

Inherited from:
IterableOps
final def addString(b: StringBuilder): b.type

Attributes

Inherited from:
IterableOnceOps
final def addString(b: StringBuilder, sep: String): b.type

Attributes

Inherited from:
IterableOnceOps
def concat[B >: A](suffix: IterableOnce[B]): Iterable[B]

Attributes

Inherited from:
IterableOps
def copyToArray[B >: A](xs: Array[B], start: Int, len: Int): Int

Attributes

Inherited from:
IterableOnceOps
def copyToArray[B >: A](xs: Array[B], start: Int): Int

Attributes

Inherited from:
IterableOnceOps
def copyToArray[B >: A](xs: Array[B]): Int

Attributes

Inherited from:
IterableOnceOps
def corresponds[B](that: IterableOnce[B])(p: (A, B) => Boolean): Boolean

Attributes

Inherited from:
IterableOnceOps
def dropRight(n: Int): Iterable[A]

Attributes

Inherited from:
IterableOps
override def empty: Iterable[A]

Attributes

Definition Classes
Inherited from:
IterableFactoryDefaults
def flatten[B](implicit asIterable: A => IterableOnce[B]): Iterable[B]

Attributes

Inherited from:
IterableOps
def fold[A1 >: A](z: A1)(op: (A1, A1) => A1): A1

Attributes

Inherited from:
IterableOnceOps
def foldRight[B](z: B)(op: (A, B) => B): B

Attributes

Inherited from:
IterableOnceOps
protected def fromSpecific(coll: IterableOnce[A]): Iterable[A]

Attributes

Inherited from:
IterableFactoryDefaults
def groupBy[K](f: A => K): Map[K, Iterable[A]]

Attributes

Inherited from:
IterableOps
def groupMap[K, B](key: A => K)(f: A => B): Map[K, Iterable[B]]

Attributes

Inherited from:
IterableOps
def groupMapReduce[K, B](key: A => K)(f: A => B)(reduce: (B, B) => B): Map[K, B]

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps
def init: Iterable[A]

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps
override def isTraversableAgain: Boolean

Attributes

Definition Classes
Inherited from:
IterableOps
def knownSize: Int

Attributes

Inherited from:
IterableOnce
def last: A

Attributes

Inherited from:
IterableOps
def lastOption: Option[A]

Attributes

Inherited from:
IterableOps
def lazyZip[B](that: Iterable[B]): LazyZip2[A, B, Iterable.this.type]

Attributes

Inherited from:
Iterable
final def mkString: String

Attributes

Inherited from:
IterableOnceOps
final def mkString(sep: String): String

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
IterableOnceOps
protected def newSpecificBuilder: Builder[A, Iterable[A]]

Attributes

Inherited from:
IterableFactoryDefaults

Attributes

Inherited from:
IterableOnceOps
def partition(p: A => Boolean): (Iterable[A], Iterable[A])

Attributes

Inherited from:
IterableOps
def partitionMap[A1, A2](f: A => Either[A1, A2]): (Iterable[A1], Iterable[A2])

Attributes

Inherited from:
IterableOps
def reduceRight[B >: A](op: (A, B) => B): B

Attributes

Inherited from:
IterableOnceOps
def reduceRightOption[B >: A](op: (A, B) => B): Option[B]

Attributes

Inherited from:
IterableOnceOps
protected def reversed: Iterable[A]

Attributes

Inherited from:
IterableOnceOps
def scan[B >: A](z: B)(op: (B, B) => B): Iterable[B]

Attributes

Inherited from:
IterableOps
def scanRight[B](z: B)(op: (A, B) => B): Iterable[B]

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps
final def sizeIs: SizeCompareOps

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps
def stepper[S <: Stepper[_]](implicit shape: StepperShape[A, S]): S

Attributes

Inherited from:
IterableOnce
def tail: Iterable[A]

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps
def takeRight(n: Int): Iterable[A]

Attributes

Inherited from:
IterableOps
override def tapEach[U](f: A => U): Iterable[A]

Attributes

Definition Classes
Inherited from:
IterableOps
def toArray[B >: A : ClassTag]: Array[B]

Attributes

Inherited from:
IterableOnceOps
final def toBuffer[B >: A]: Buffer[B]

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
IterableOnceOps
def toList: List[A]

Attributes

Inherited from:
IterableOnceOps
def toMap[K, V](implicit ev: A <:< (K, V)): Map[K, V]

Attributes

Inherited from:
IterableOnceOps
def toSeq: Seq[A]

Attributes

Inherited from:
IterableOnceOps
def toSet[B >: A]: Set[B]

Attributes

Inherited from:
IterableOnceOps
override def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Iterable -> Any
Inherited from:
Iterable
def toVector: Vector[A]

Attributes

Inherited from:
IterableOnceOps
def transpose[B](implicit asIterable: A => Iterable[B]): Iterable[Iterable[B]]

Attributes

Inherited from:
IterableOps
def unzip[A1, A2](implicit asPair: A => (A1, A2)): (Iterable[A1], Iterable[A2])

Attributes

Inherited from:
IterableOps
def unzip3[A1, A2, A3](implicit asTriple: A => (A1, A2, A3)): (Iterable[A1], Iterable[A2], Iterable[A3])

Attributes

Inherited from:
IterableOps
def view: View[A]

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps
def zip[B](that: IterableOnce[B]): Iterable[(A, B)]

Attributes

Inherited from:
IterableOps
def zipAll[A1 >: A, B](that: Iterable[B], thisElem: A1, thatElem: B): Iterable[(A1, B)]

Attributes

Inherited from:
IterableOps

Deprecated and Inherited methods

def ++:[B >: A](that: IterableOnce[B]): Iterable[B]

Attributes

Deprecated
[Since version 2.13.0] Use ++ instead of ++: for collections of type Iterable
Inherited from:
IterableOps
final def /:[B](z: B)(op: (B, A) => B): B

Attributes

Deprecated
[Since version 2.13.0] Use foldLeft instead of /:
Inherited from:
IterableOnceOps
final def :\[B](z: B)(op: (A, B) => B): B

Attributes

Deprecated
[Since version 2.13.0] Use foldRight instead of :\\
Inherited from:
IterableOnceOps
def aggregate[B](z: => B)(seqop: (B, A) => B, combop: (B, B) => B): B

Attributes

Deprecated
[Since version 2.13.0] For sequential collections, prefer `foldLeft(z)(seqop)`. For parallel collections, use `ParIterableLike#aggregate`.
Inherited from:
IterableOnceOps

Attributes

Deprecated
[Since version 2.13.0] Use iterableFactory instead
Inherited from:
IterableOps
final def copyToBuffer[B >: A](dest: Buffer[B]): Unit

Attributes

Deprecated
[Since version 2.13.0] Use `dest ++= coll` instead
Inherited from:
IterableOnceOps

Attributes

Deprecated
[Since version 2.13.0] Check .knownSize instead of .hasDefiniteSize for more actionable information (see scaladoc for details)
Inherited from:
IterableOnceOps
final def repr: Iterable[A]

Attributes

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
def seq: Iterable.this.type

Attributes

Deprecated
[Since version 2.13.0] Iterable.seq always returns the iterable itself
Inherited from:
Iterable
final def toIterable: Iterable.this.type

Attributes

Deprecated
[Since version 2.13.7] toIterable is internal and will be made protected; its name is similar to `toList` or `toSeq`, but it doesn\'t copy non-immutable collections
Inherited from:
Iterable
final def toIterator: Iterator[A]

Attributes

Deprecated
[Since version 2.13.0] Use .iterator instead of .toIterator
Inherited from:
IterableOnceOps
final def toStream: Stream[A]

Attributes

Deprecated
[Since version 2.13.0] Use .to(LazyList) instead of .toStream
Inherited from:
IterableOnceOps
final def toTraversable: Iterable[A]

Attributes

Deprecated
[Since version 2.13.0] toTraversable is internal and will be made protected; its name is similar to `toList` or `toSeq`, but it doesn\'t copy non-immutable collections
Inherited from:
IterableOps
def view(from: Int, until: Int): View[A]

Attributes

Deprecated
[Since version 2.13.0] Use .view.slice(from, until) instead of .view(from, until)
Inherited from:
IterableOps