Skip to content

Instantly share code, notes, and snippets.

@gkazior
Last active June 18, 2016 08:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gkazior/dc1e8f48282afdad4e24 to your computer and use it in GitHub Desktop.
Save gkazior/dc1e8f48282afdad4e24 to your computer and use it in GitHub Desktop.
Sample scaladocs
/** Applies a function `f` to all elements of this $coll.
*
* {{{
* // here is sample code
* val c = Seq(1,2,3)
* c foreach { i => println(s"got $i")}
* }}}
*
* @param f the function that is applied for its side-effect to every element.
* The result of function `f` is discarded.
*
* @tparam U the type parameter describing the result of function `f`.
* This result will always be ignored. Typically `U` is `Unit`,
* but this is not necessary.
*
* @usecase def foreach(f: A => Unit): Unit
* @inheritdoc
*
* Note: this method underlies the implementation of most other bulk operations.
* It's important to implement this method in an efficient way.
*
* @author gkazior
* @see scala.collection.List
* @throws java.lang.NullPointerException for null input ;-)
* @since 1.7
* @todo do something useful
* @deprecated
* @note for scaladoc
*
* = Note for `countChange` =
* `countChange` implementation is simpler but slower
*
* - sequential result = 177863
* - sequential count time: 136.4330980375 ms
*
* while my `countChangeCoursera1`
*
* - sequential result (Coursera1)= 177863
* - sequential count time (Coursera1): 47.5624339125 ms
* = Note for Scaladoc =
*
* Scaladoc links:
* - [[https://wiki.scala-lang.org/display/SW/Syntax scaladoc syntax page]]
* - [[http://lampsvn.epfl.ch/trac/scala-old/wiki/Scaladoc/AuthorDocs]]
*
* @example countChange(5, List(1,2))
*/
def foreach[U](f: A => U): Unit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment