alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Scala example source code file (IterableMethods.scala)

This example Scala source code file (IterableMethods.scala) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Scala tags/keywords

a, a, a1, a1, b, canbuildfrom, geniterable, int, int, iterable, iterator, that, that, this

The Scala IterableMethods.scala source code

/*                     __                                               *\
**     ________ ___   / /  ___     Scala API                            **
**    / __/ __// _ | / /  / _ |    (c) 2003-2011, LAMP/EPFL             **
**  __\ \/ /__/ __ |/ /__/ __ |    http://scala-lang.org/               **
** /____/\___/_/ |_/____/_/ | |                                         **
**                          |/                                          **
\*                                                                      */

package scala.collection
package interfaces

import generic._
import mutable.Buffer
import scala.reflect.ClassManifest
import annotation.unchecked.uncheckedVariance

/**
 * @since 2.8
 */
trait IterableMethods[+A, +This <: IterableLike[A, This] with Iterable[A]] extends TraversableMethods[A, This] {
  self: Iterable[A] =>
  
  // abstract
  def iterator: Iterator[A]

  // concrete
  def dropRight(n: Int): Iterable[A]
  def grouped(size: Int): Iterator[Iterable[A]]
  def sameElements[B >: A](that: GenIterable[B]): Boolean
  def sliding[B >: A](size: Int): Iterator[Iterable[A]]
  def sliding[B >: A](size: Int, step: Int): Iterator[Iterable[A]]
  def takeRight(n: Int): Iterable[A]
  def zipAll[B, A1 >: A, That](that: GenIterable[B], e1: A1, e2: B)(implicit bf: CanBuildFrom[This, (A1, B), That]): That
  def zipWithIndex[A1 >: A, That](implicit bf: CanBuildFrom[This, (A1, Int), That]): That
  def zip[A1 >: A, B, That](that: GenIterable[B])(implicit bf: CanBuildFrom[This, (A1, B), That]): That
  
  override def view: IterableView[A, This]
  override def view(from: Int, until: Int): IterableView[A, This]
}

Other Scala examples (source code examples)

Here is a short list of links related to this Scala IterableMethods.scala source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.