From 75ef45161d0599e43c33cbba8d253088bdfa9a79 Mon Sep 17 00:00:00 2001 From: Vlad Ureche Date: Mon, 19 Mar 2012 22:48:08 +0100 Subject: Adapted usecases to full signature display --- src/library/scala/collection/immutable/List.scala | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/library/scala/collection/immutable/List.scala') diff --git a/src/library/scala/collection/immutable/List.scala b/src/library/scala/collection/immutable/List.scala index 381fcf3117..870c179b2d 100644 --- a/src/library/scala/collection/immutable/List.scala +++ b/src/library/scala/collection/immutable/List.scala @@ -93,8 +93,12 @@ sealed abstract class List[+A] extends AbstractSeq[A] * @param x the element to prepend. * @return a list which contains `x` as first element and * which continues with this list. - * @example `1 :: List(2, 3) = List(2, 3).::(1) = List(1, 2, 3)` + * * @usecase def ::(x: A): List[A] + * @inheritdoc + * + * Example: + * {{{1 :: List(2, 3) = List(2, 3).::(1) = List(1, 2, 3)}}} */ def ::[B >: A] (x: B): List[B] = new scala.collection.immutable.::(x, this) @@ -103,8 +107,12 @@ sealed abstract class List[+A] extends AbstractSeq[A] * @param prefix The list elements to prepend. * @return a list resulting from the concatenation of the given * list `prefix` and this list. - * @example `List(1, 2) ::: List(3, 4) = List(3, 4).:::(List(1, 2)) = List(1, 2, 3, 4)` + * * @usecase def :::(prefix: List[A]): List[A] + * @inheritdoc + * + * Example: + * {{{List(1, 2) ::: List(3, 4) = List(3, 4).:::(List(1, 2)) = List(1, 2, 3, 4)}}} */ def :::[B >: A](prefix: List[B]): List[B] = if (isEmpty) prefix @@ -117,7 +125,9 @@ sealed abstract class List[+A] extends AbstractSeq[A] * * @param prefix the prefix to reverse and then prepend * @return the concatenation of the reversed prefix and the current list. + * * @usecase def reverse_:::(prefix: List[A]): List[A] + * @inheritdoc */ def reverse_:::[B >: A](prefix: List[B]): List[B] = { var these: List[B] = this @@ -137,7 +147,9 @@ sealed abstract class List[+A] extends AbstractSeq[A] * @tparam B the element type of the returned collection. * @return a list resulting from applying the given function * `f` to each element of this list and collecting the results. + * * @usecase def mapConserve(f: A => A): List[A] + * @inheritdoc */ def mapConserve[B >: A <: AnyRef](f: A => B): List[B] = { @tailrec -- cgit v1.2.3