diff options
Diffstat (limited to 'src/library')
6 files changed, 0 insertions, 344 deletions
diff --git a/src/library/scala/collection/interfaces/IterableMethods.scala b/src/library/scala/collection/interfaces/IterableMethods.scala deleted file mode 100644 index 8efc3fe6f9..0000000000 --- a/src/library/scala/collection/interfaces/IterableMethods.scala +++ /dev/null @@ -1,38 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2011, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -package scala.collection -package interfaces - -import generic._ -import mutable.Buffer -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(size: Int): Iterator[Iterable[A]] - def sliding(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] -} diff --git a/src/library/scala/collection/interfaces/MapMethods.scala b/src/library/scala/collection/interfaces/MapMethods.scala deleted file mode 100644 index bc38ccdd2e..0000000000 --- a/src/library/scala/collection/interfaces/MapMethods.scala +++ /dev/null @@ -1,45 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2011, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -package scala.collection -package interfaces - -import generic._ - -/** - * @since 2.8 - */ -trait MapMethods[A, +B, +This <: MapLike[A, B, This] with Map[A, B]] - extends IterableMethods[(A, B), This] - with SubtractableMethods[A, This] { - self: Map[A, B] => - - // abstract - def empty: This - def get(key: A): Option[B] - def iterator: Iterator[(A, B)] - def + [B1 >: B] (kv: (A, B1)): Map[A, B1] - def - (key: A): This - - // concrete - def getOrElse[B1 >: B](key: A, default: => B1): B1 - def apply(key: A): B - def contains(key: A): Boolean - def isDefinedAt(key: A): Boolean - def keys: Iterable[A] - def keysIterator: Iterator[A] - def keySet: Set[A] - def values: Iterable[B] - def valuesIterator: Iterator[B] - def default(key: A): B - def filterKeys(p: A => Boolean): Map[A, B] - def mapValues[C](f: B => C): Map[A, C] - def updated [B1 >: B](key: A, value: B1): Map[A, B1] - def + [B1 >: B] (elem1: (A, B1), elem2: (A, B1), elems: (A, B1) *): Map[A, B1] - def ++[B1 >: B](xs: GenTraversableOnce[(A, B1)]): Map[A, B1] -} diff --git a/src/library/scala/collection/interfaces/SeqMethods.scala b/src/library/scala/collection/interfaces/SeqMethods.scala deleted file mode 100644 index 4327073d21..0000000000 --- a/src/library/scala/collection/interfaces/SeqMethods.scala +++ /dev/null @@ -1,70 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2011, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -package scala.collection -package interfaces - -import generic._ -import mutable.Buffer - -/** - * @since 2.8 - */ -trait SeqMethods[+A, +This <: SeqLike[A, This] with Seq[A]] extends IterableMethods[A, This] { - self: Seq[A] => - - // abstract - def apply(idx: Int): A - def length: Int - - // concrete - def +:[B >: A, That](elem: B)(implicit bf: CanBuildFrom[This, B, That]): That - def :+[B >: A, That](elem: B)(implicit bf: CanBuildFrom[This, B, That]): That - def combinations(n: Int): Iterator[This] - def contains(elem: Any): Boolean - def containsSlice[B](that: Seq[B]): Boolean - def corresponds[B](that: Seq[B])(p: (A,B) => Boolean): Boolean - def diff[B >: A, That](that: Seq[B]): This - def distinct: This - def endsWith[B](that: Seq[B]): Boolean - def indexOfSlice[B >: A](that: Seq[B]): Int - def indexOfSlice[B >: A](that: Seq[B], fromIndex: Int): Int - def indexOf[B >: A](elem: B): Int - def indexOf[B >: A](elem: B, from: Int): Int - def indexWhere(p: A => Boolean): Int - def indexWhere(p: A => Boolean, from: Int): Int - def indices: Range - def intersect[B >: A, That](that: Seq[B]): This - def isDefinedAt(x: Int): Boolean - def lastIndexOfSlice[B >: A](that: Seq[B]): Int - def lastIndexOfSlice[B >: A](that: Seq[B], fromIndex: Int): Int - def lastIndexOf[B >: A](elem: B): Int - def lastIndexOf[B >: A](elem: B, end: Int): Int - def lastIndexWhere(p: A => Boolean): Int - def lastIndexWhere(p: A => Boolean, end: Int): Int - def lengthCompare(len: Int): Int - def padTo[B >: A, That](len: Int, elem: B)(implicit bf: CanBuildFrom[This, B, That]): That - def patch[B >: A, That](from: Int, patch: GenSeq[B], replaced: Int)(implicit bf: CanBuildFrom[This, B, That]): That - def permutations: Iterator[This] - def prefixLength(p: A => Boolean): Int - def reverse: This - def reverseIterator: Iterator[A] - def reverseMap[B, That](f: A => B)(implicit bf: CanBuildFrom[This, B, That]): That - def segmentLength(p: A => Boolean, from: Int): Int - def sortBy[B](f: A => B)(implicit ord: Ordering[B]): This - def sortWith(lt: (A, A) => Boolean): This - def sorted[B >: A](implicit ord: Ordering[B]): This - def startsWith[B](that: Seq[B]): Boolean - def startsWith[B](that: Seq[B], offset: Int): Boolean - def union[B >: A, That](that: Seq[B])(implicit bf: CanBuildFrom[This, B, That]): That - def updated[B >: A, That](index: Int, elem: B)(implicit bf: CanBuildFrom[This, B, That]): That - - // refinements - def view: SeqView[A, This] - def view(from: Int, until: Int): SeqView[A, This] -} diff --git a/src/library/scala/collection/interfaces/SetMethods.scala b/src/library/scala/collection/interfaces/SetMethods.scala deleted file mode 100644 index 3b6214f45c..0000000000 --- a/src/library/scala/collection/interfaces/SetMethods.scala +++ /dev/null @@ -1,51 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2011, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -package scala.collection -package interfaces - -import generic._ -import mutable.Buffer -import annotation.unchecked.uncheckedVariance - -/** - * @since 2.8 - */ -trait SubtractableMethods[A, +This <: Subtractable[A, This]] { - def -(elem: A): This - def -(elem1: A, elem2: A, elems: A*): This - def --(xs: TraversableOnce[A]): This -} - -/** - * @since 2.8 - */ -trait SetMethods[A, +This <: SetLike[A, This] with Set[A]] - extends IterableMethods[A, This] - with SubtractableMethods[A, This] { - self: Set[A] => - - // abstract - def empty: This - def contains(elem: A): Boolean - def + (elem: A): This - def - (elem: A): This - - // concrete - def & (that: Set[A]): This - def &~ (that: Set[A]): This - def + (elem1: A, elem2: A, elems: A*): This - def apply(elem: A): Boolean - def diff(that: Set[A]): This - def intersect(that: Set[A]): This - def subsetOf(that: Set[A]): Boolean - def subsets(len: Int): Iterator[This] - def subsets: Iterator[This] - def union(that: Set[A]): This - def | (that: Set[A]): This -} diff --git a/src/library/scala/collection/interfaces/TraversableMethods.scala b/src/library/scala/collection/interfaces/TraversableMethods.scala deleted file mode 100644 index 8aba39093d..0000000000 --- a/src/library/scala/collection/interfaces/TraversableMethods.scala +++ /dev/null @@ -1,63 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2011, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -package scala.collection -package interfaces - -import generic._ - -/** - * @since 2.8 - */ -trait TraversableMethods[+A, +This <: TraversableLike[A, This]] extends TraversableOnceMethods[A] { - self: Traversable[A] => - - // maps/iteration - def flatMap[B, That](f: A => GenTraversableOnce[B])(implicit bf: CanBuildFrom[This, B, That]): That - def map[B, That](f: A => B)(implicit bf: CanBuildFrom[This, B, That]): That - def collect[B, That](pf: PartialFunction[A, B])(implicit bf: CanBuildFrom[This, B, That]): That - def scanLeft[B, That](z: B)(op: (B, A) => B)(implicit bf: CanBuildFrom[This, B, That]): That - def scanRight[B, That](z: B)(op: (A, B) => B)(implicit bf: CanBuildFrom[This, B, That]): That - - // new collections - def ++:[B >: A, That](that: TraversableOnce[B])(implicit bf: CanBuildFrom[This, B, That]): That - def ++[B >: A, That](that: GenTraversableOnce[B])(implicit bf: CanBuildFrom[This, B, That]): That - - // element retrieval - def head: A - def headOption: Option[A] - def last: A - def lastOption: Option[A] - - // subcollections - def drop(n: Int): Traversable[A] - def dropWhile(p: A => Boolean): Traversable[A] - def filter(p: A => Boolean): Traversable[A] - def filterNot(p: A => Boolean): Traversable[A] - def init: Traversable[A] - def inits: Iterator[This] - def slice(from: Int, until: Int): Traversable[A] - def tail: Traversable[A] - def tails: Iterator[This] - def take(n: Int): Traversable[A] - def takeWhile(p: A => Boolean): Traversable[A] - def withFilter(p: A => Boolean): FilterMonadic[A, Traversable[A]] - - // subdivisions - def groupBy[K](f: A => K): Map[K, Traversable[A]] - def partition(p: A => Boolean): (Traversable[A], Traversable[A]) - def span(p: A => Boolean): (Traversable[A], Traversable[A]) - def splitAt(n: Int): (Traversable[A], Traversable[A]) - - // info - def stringPrefix: String - - // views - def view: TraversableView[A, This] - def view(from: Int, until: Int): TraversableView[A, This] -} diff --git a/src/library/scala/collection/interfaces/TraversableOnceMethods.scala b/src/library/scala/collection/interfaces/TraversableOnceMethods.scala deleted file mode 100644 index 543d59d118..0000000000 --- a/src/library/scala/collection/interfaces/TraversableOnceMethods.scala +++ /dev/null @@ -1,77 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2011, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -package scala.collection -package interfaces - -trait TraversableOnceMethods[+A] { - self: TraversableOnce[A] => - - def foreach[U](f: A => U): Unit - def size: Int - protected[this] def reversed: TraversableOnce[A] - - // tests - def hasDefiniteSize: Boolean - def isEmpty: Boolean - def isTraversableAgain: Boolean - def nonEmpty: Boolean - - // applying a predicate - def collectFirst[B](pf: PartialFunction[A, B]): Option[B] - def count(p: A => Boolean): Int - def exists(p: A => Boolean): Boolean - def find(p: A => Boolean): Option[A] - def forall(p: A => Boolean): Boolean - - // folds - def /:[B](z: B)(op: (B, A) => B): B - def :\[B](z: B)(op: (A, B) => B): B - def foldLeft[B](z: B)(op: (B, A) => B): B - def foldRight[B](z: B)(op: (A, B) => B): B - def reduceLeftOption[B >: A](op: (B, A) => B): Option[B] - def reduceLeft[B >: A](op: (B, A) => B): B - def reduceRightOption[B >: A](op: (A, B) => B): Option[B] - def reduceRight[B >: A](op: (A, B) => B): B - - // copies - def copyToArray[B >: A](xs: Array[B]): Unit - def copyToArray[B >: A](xs: Array[B], start: Int): Unit - def copyToArray[B >: A](xs: Array[B], start: Int, len: Int): Unit - def copyToBuffer[B >: A](dest: mutable.Buffer[B]): Unit - - // conversions - def toArray[B >: A : ArrayTag]: Array[B] - def toBuffer[B >: A]: mutable.Buffer[B] - def toIndexedSeq: immutable.IndexedSeq[A] - def toIterable: Iterable[A] - def toIterator: Iterator[A] - def toList: List[A] - def toMap[T, U](implicit ev: A <:< (T, U)): immutable.Map[T, U] - def toSeq: Seq[A] - def toSet[B >: A]: immutable.Set[B] - def toStream: Stream[A] - def toTraversable: Traversable[A] - - // type-constrained folds - def maxBy[B](f: A => B)(implicit cmp: Ordering[B]): A - def max[B >: A](implicit cmp: Ordering[B]): A - def minBy[B](f: A => B)(implicit cmp: Ordering[B]): A - def min[B >: A](implicit cmp: Ordering[B]): A - def product[B >: A](implicit num: Numeric[B]): B - def sum[B >: A](implicit num: Numeric[B]): B - - // strings - def mkString(start: String, sep: String, end: String): String - def mkString(sep: String): String - def mkString: String - - def addString(buf: StringBuilder, start: String, sep: String, end: String): StringBuilder - def addString(buf: StringBuilder, sep: String): StringBuilder - def addString(buf: StringBuilder): StringBuilder -} |