From e1bfe57368457ec47091ade4d949f4274fc43dae Mon Sep 17 00:00:00 2001 From: michelou Date: Mon, 15 Jan 2007 09:36:23 +0000 Subject: updated scaladoc comments in scala/Seq.scala --- src/library/scala/Seq.scala | 61 +++++++++++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 22 deletions(-) diff --git a/src/library/scala/Seq.scala b/src/library/scala/Seq.scala index 6ff68ee6f5..83deeef39e 100644 --- a/src/library/scala/Seq.scala +++ b/src/library/scala/Seq.scala @@ -1,6 +1,6 @@ /* __ *\ ** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL ** +** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL ** ** __\ \/ /__/ __ |/ /__/ __ | ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** @@ -12,7 +12,7 @@ package scala import Predef.{IllegalArgumentException, NoSuchElementException} -import collection.mutable.{ArrayBuffer} +import collection.mutable.ArrayBuffer object Seq { @@ -23,11 +23,18 @@ object Seq { def elements = Iterator.empty } - def unapplySeq[A](x:Any): Option[Seq[A]] = - if(x.isInstanceOf[Seq[A]]) Some(x.asInstanceOf[Seq[A]]) else None + /** ... + * + * @param x ... + * @return ... + */ + def unapplySeq[A](x: Any): Option[Seq[A]] = + if (x.isInstanceOf[Seq[A]]) Some(x.asInstanceOf[Seq[A]]) else None - /** builds a singleton sequence - * @author buraq + /** Builds a singleton sequence. + * + * @param x ... + * @return ... */ def single[A](x: A) = new Seq[A] { def length = 1 @@ -75,10 +82,10 @@ trait Seq[+A] extends AnyRef with PartialFunction[Int, A] with Iterable[A] { */ def isEmpty: Boolean = { length == 0 } - /** Appends two iterable objects + /** Appends two iterable objects. * - * @return the new iterable object - * @deprecated use ++ instead + * @return the new iterable object + * @deprecated use ++ instead */ [deprecated] override def concat [B >: A](that: Iterable[B]): Seq[B] = { val buf = new ArrayBuffer[B] @@ -87,9 +94,10 @@ trait Seq[+A] extends AnyRef with PartialFunction[Int, A] with Iterable[A] { buf } - /** Appends two iterable objects + /** Appends two iterable objects. * - * @return the new iterable object + * @param that .. + * @return the new iterable object */ override def ++ [B >: A](that: Iterable[B]): Seq[B] = { val buf = new ArrayBuffer[B] @@ -100,7 +108,8 @@ trait Seq[+A] extends AnyRef with PartialFunction[Int, A] with Iterable[A] { /** Is this partial function defined for the index x? * - * @return true, iff x is a legal sequence index. + * @param x .. + * @return true, iff x is a legal sequence index. */ def isDefinedAt(x: Int): Boolean = (x >= 0) && (x < length) @@ -124,11 +133,12 @@ trait Seq[+A] extends AnyRef with PartialFunction[Int, A] with Iterable[A] { if (found) i else -1; } - /** Returns the sequence resulting from applying the given function f to each - * element of this sequence. + /** Returns the sequence resulting from applying the given function + * f to each element of this sequence. * * @param f function to apply to each element. - * @return f(a0), ..., f(an) if this sequence is a0, ..., an. + * @return f(a0), ..., f(an) if this + * sequence is a0, ..., an. */ override def map[B](f: A => B): Seq[B] = { // todo: malformed scala signature suing build when replaced by @@ -171,7 +181,8 @@ trait Seq[+A] extends AnyRef with PartialFunction[Int, A] with Iterable[A] { override def take(n: Int): Seq[A] = super.take(n).asInstanceOf[Seq[A]] /** Returns this sequence without its n first elements - * If this sequence has less than n elements, the empty sequence is returned. + * If this sequence has less than n elements, the empty + * sequence is returned. * * @param n the number of elements to drop * @return the new sequence @@ -215,17 +226,23 @@ trait Seq[+A] extends AnyRef with PartialFunction[Int, A] with Iterable[A] { def contains(elem: Any): Boolean = exists (.==(elem)) /** Returns a subsequence starting from index from - * consisting of len elements. - */ + * consisting of len elements. + * + * @param from .. + * @param len .. + * @return .. + */ def slice(from: Int, len: Int): Seq[A] = this.drop(from).take(len) /** Returns a subsequence starting from index from - * consisting of len elements. - * @deprecated; use slice instead - */ + * consisting of len elements. + * + * @deprecated use slice instead + */ [deprecated] def subseq(from: Int, end: Int): Seq[A] = slice(from, end - from) - /** Converts this sequence to a fresh Array with length elements */ + /** Converts this sequence to a fresh Array with length elements. + */ def toArray[B >: A]: Array[B] = { val result = new Array[B](length) copyToArray(result, 0) -- cgit v1.2.3