Skip to content

Commit

Permalink
Merge pull request #3841 from Ichoran/issue/5200
Browse files Browse the repository at this point in the history
SI-5200  Incorrect advice for implementing mutable.Set in scaladoc
  • Loading branch information
adriaanm committed Jul 3, 2014
2 parents 300d646 + 23ae5c4 commit 4dcb51c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
7 changes: 3 additions & 4 deletions src/library/scala/collection/SetLike.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@ import parallel.ParSet
/** A template trait for sets.
*
* $setNote
* '''Implementation note:'''
* This trait provides most of the operations of a `Set` independently of its representation.
* It is typically inherited by concrete implementations of sets.
* $setTags
* @since 2.8
*
* @define setNote
*
* A set is a collection that contains no duplicate elements.
*
* '''Implementation note:'''
* This trait provides most of the operations of a `Set` independently of its representation.
* It is typically inherited by concrete implementations of sets.
*
* To implement a concrete set, you need to provide implementations of the
* following methods:
* {{{
Expand Down
17 changes: 9 additions & 8 deletions src/library/scala/collection/mutable/SetLike.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,34 @@ import scala.annotation.migration
import parallel.mutable.ParSet

/** A template trait for mutable sets of type `mutable.Set[A]`.
*
* This trait provides most of the operations of a `mutable.Set` independently of its representation.
* It is typically inherited by concrete implementations of sets.
*
* $setNote
*
* @tparam A the type of the elements of the set
* @tparam This the type of the set itself.
*
* $setnote
*
* @author Martin Odersky
* @version 2.8
* @since 2.8
*
* @define setnote
* @note
* This trait provides most of the operations of a `mutable.Set` independently of its representation.
* It is typically inherited by concrete implementations of sets.
* @define setNote
*
* To implement a concrete mutable set, you need to provide implementations
* of the following methods:
* {{{
* def contains(elem: A): Boolean
* def iterator: Iterator[A]
* def += (elem: A): this.type
* def -= (elem: A): this.type</pre>
* def -= (elem: A): this.type
* }}}
* If you wish that methods like `take`,
* `drop`, `filter` return the same kind of set,
* you should also override:
* {{{
* def empty: This</pre>
* def empty: This
* }}}
* It is also good idea to override methods `foreach` and
* `size` for efficiency.
Expand Down

0 comments on commit 4dcb51c

Please sign in to comment.