diff options
author | Paul Phillips <paulp@improving.org> | 2011-07-29 23:58:45 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-07-29 23:58:45 +0000 |
commit | 67a63278a6c4e9347792219086f11a87d177eee7 (patch) | |
tree | 411bab57bbcd9f408ee4230420a7897de952f58b /src/library/scala/collection/TraversableOnce.scala | |
parent | af412cd72e6e35e7c76ee24e9fa65b73293f0082 (diff) | |
download | scala-67a63278a6c4e9347792219086f11a87d177eee7.tar.gz scala-67a63278a6c4e9347792219086f11a87d177eee7.tar.bz2 scala-67a63278a6c4e9347792219086f11a87d177eee7.zip |
- Update Scaladoc for LinkedList and for some o...
- Update Scaladoc for LinkedList and for some of the functions/operators
- that it inherits. Completed Scaladoc for append Added example
- in GenSeqLike for apply. Added $collectExample to collect in
- GenTraversableLike and supplied an actual example in LinkedList
Contributed by Donald McLean.
Diffstat (limited to 'src/library/scala/collection/TraversableOnce.scala')
-rw-r--r-- | src/library/scala/collection/TraversableOnce.scala | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/library/scala/collection/TraversableOnce.scala b/src/library/scala/collection/TraversableOnce.scala index 01619b0ab0..4f125b4090 100644 --- a/src/library/scala/collection/TraversableOnce.scala +++ b/src/library/scala/collection/TraversableOnce.scala @@ -271,6 +271,19 @@ trait TraversableOnce[+A] extends GenTraversableOnce[A] { * Inside, the string representations (w.r.t. the method `toString`) * of all elements of this $coll are separated by the string `sep`. * + * Example: + * + * {{{ + * scala> val a = LinkedList(1,2,3,4) + * a: scala.collection.mutable.LinkedList[Int] = LinkedList(1, 2, 3, 4) + * + * scala> val b = new StringBuilder() + * b: StringBuilder = + * + * scala> a.addString(b, "LinkedList(", ", ", ")") + * res1: StringBuilder = LinkedList(1, 2, 3, 4) + * }}} + * * @param b the string builder to which elements are appended. * @param start the starting string. * @param sep the separator string. @@ -300,6 +313,19 @@ trait TraversableOnce[+A] extends GenTraversableOnce[A] { * The written text consists of the string representations (w.r.t. the method `toString`) * of all elements of this $coll, separated by the string `sep`. * + * Example: + * + * {{{ + * scala> val a = LinkedList(1,2,3,4) + * a: scala.collection.mutable.LinkedList[Int] = LinkedList(1, 2, 3, 4) + * + * scala> val b = new StringBuilder() + * b: StringBuilder = + * + * scala> a.addString(b, ", ") + * res0: StringBuilder = 1, 2, 3, 4 + * }}} + * * @param b the string builder to which elements are appended. * @param sep the separator string. * @return the string builder `b` to which elements were appended. @@ -310,6 +336,19 @@ trait TraversableOnce[+A] extends GenTraversableOnce[A] { * The written text consists of the string representations (w.r.t. the method * `toString`) of all elements of this $coll without any separator string. * + * Example: + * + * {{{ + * scala> val a = LinkedList(1,2,3,4) + * a: scala.collection.mutable.LinkedList[Int] = LinkedList(1, 2, 3, 4) + * + * scala> val b = new StringBuilder() + * b: StringBuilder = + * + * scala> val h = a.addString(b) + * b: StringBuilder = 1234 + * }}} + * @param b the string builder to which elements are appended. * @return the string builder `b` to which elements were appended. */ |