Skip to content

Commit 75ef451

Browse files
committed
Adapted usecases to full signature display
1 parent c7d8525 commit 75ef451

14 files changed

+359
-243
lines changed

src/library/scala/collection/GenIterableLike.scala

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -39,27 +39,26 @@ trait GenIterableLike[+A, +Repr] extends Any with GenTraversableLike[A, Repr] {
3939
def iterator: Iterator[A]
4040

4141
/** Checks if the other iterable collection contains the same elements in the same order as this $coll.
42-
*
43-
* $orderDependent
44-
* $willNotTerminateInf
4542
*
4643
* @param that the collection to compare with.
4744
* @tparam B the type of the elements of collection `that`.
4845
* @return `true`, if both collections contain the same elements in the same order, `false` otherwise.
4946
*
5047
* @usecase def sameElements(that: GenIterable[A]): Boolean
48+
* @inheritdoc
5149
*
52-
* @param that the collection to compare with.
53-
* @return `true`, if both collections contain the same elements in the same order, `false` otherwise.
50+
* $orderDependent
51+
* $willNotTerminateInf
52+
*
53+
* @param that the collection to compare with.
54+
* @return `true`, if both collections contain the same elements in the same order, `false` otherwise.
5455
*/
5556
def sameElements[A1 >: A](that: GenIterable[A1]): Boolean
5657

5758
/** Returns a $coll formed from this $coll and another iterable collection
5859
* by combining corresponding elements in pairs.
5960
* If one of the two collections is longer than the other, its remaining elements are ignored.
6061
*
61-
* $orderDependent
62-
*
6362
* @param that The iterable providing the second half of each result pair
6463
* @tparam A1 the type of the first half of the returned pairs (this is always a supertype
6564
* of the collection's element type `A`).
@@ -71,18 +70,19 @@ trait GenIterableLike[+A, +Repr] extends Any with GenTraversableLike[A, Repr] {
7170
* of the returned collection is the minimum of the lengths of this $coll and `that`.
7271
*
7372
* @usecase def zip[B](that: GenIterable[B]): $Coll[(A, B)]
73+
* @inheritdoc
7474
*
75-
* @param that The iterable providing the second half of each result pair
76-
* @tparam B the type of the second half of the returned pairs
77-
* @return a new $coll containing pairs consisting of
78-
* corresponding elements of this $coll and `that`. The length
79-
* of the returned collection is the minimum of the lengths of this $coll and `that`.
75+
* $orderDependent
76+
*
77+
* @param that The iterable providing the second half of each result pair
78+
* @tparam B the type of the second half of the returned pairs
79+
* @return a new $coll containing pairs consisting of
80+
* corresponding elements of this $coll and `that`. The length
81+
* of the returned collection is the minimum of the lengths of this $coll and `that`.
8082
*/
8183
def zip[A1 >: A, B, That](that: GenIterable[B])(implicit bf: CBF[Repr, (A1, B), That]): That
8284

8385
/** Zips this $coll with its indices.
84-
*
85-
* $orderDependent
8686
*
8787
* @tparam A1 the type of the first half of the returned pairs (this is always a supertype
8888
* of the collection's element type `A`).
@@ -98,11 +98,14 @@ trait GenIterableLike[+A, +Repr] extends Any with GenTraversableLike[A, Repr] {
9898
* $coll paired with their index. Indices start at `0`.
9999
*
100100
* @usecase def zipWithIndex: $Coll[(A, Int)]
101+
* @inheritdoc
101102
*
102-
* @return A new $coll containing pairs consisting of all elements of this
103-
* $coll paired with their index. Indices start at `0`.
104-
* @example
105-
* `List("a", "b", "c").zipWithIndex = List(("a", 0), ("b", 1), ("c", 2))`
103+
* $orderDependent
104+
*
105+
* @return A new $coll containing pairs consisting of all elements of this
106+
* $coll paired with their index. Indices start at `0`.
107+
* @example
108+
* `List("a", "b", "c").zipWithIndex = List(("a", 0), ("b", 1), ("c", 2))`
106109
*
107110
*/
108111
def zipWithIndex[A1 >: A, That](implicit bf: CBF[Repr, (A1, Int), That]): That
@@ -112,8 +115,6 @@ trait GenIterableLike[+A, +Repr] extends Any with GenTraversableLike[A, Repr] {
112115
* If one of the two collections is shorter than the other,
113116
* placeholder elements are used to extend the shorter collection to the length of the longer.
114117
*
115-
* $orderDependent
116-
*
117118
* @param that the iterable providing the second half of each result pair
118119
* @param thisElem the element to be used to fill up the result if this $coll is shorter than `that`.
119120
* @param thatElem the element to be used to fill up the result if `that` is shorter than this $coll.
@@ -124,16 +125,19 @@ trait GenIterableLike[+A, +Repr] extends Any with GenTraversableLike[A, Repr] {
124125
* If `that` is shorter than this $coll, `thatElem` values are used to pad the result.
125126
*
126127
* @usecase def zipAll[B](that: Iterable[B], thisElem: A, thatElem: B): $Coll[(A, B)]
127-
*
128-
* @param that The iterable providing the second half of each result pair
129-
* @param thisElem the element to be used to fill up the result if this $coll is shorter than `that`.
130-
* @param thatElem the element to be used to fill up the result if `that` is shorter than this $coll.
131-
* @tparam B the type of the second half of the returned pairs
132-
* @return a new $coll containing pairs consisting of
133-
* corresponding elements of this $coll and `that`. The length
134-
* of the returned collection is the maximum of the lengths of this $coll and `that`.
135-
* If this $coll is shorter than `that`, `thisElem` values are used to pad the result.
136-
* If `that` is shorter than this $coll, `thatElem` values are used to pad the result.
128+
* @inheritdoc
129+
*
130+
* $orderDependent
131+
*
132+
* @param that The iterable providing the second half of each result pair
133+
* @param thisElem the element to be used to fill up the result if this $coll is shorter than `that`.
134+
* @param thatElem the element to be used to fill up the result if `that` is shorter than this $coll.
135+
* @tparam B the type of the second half of the returned pairs
136+
* @return a new $coll containing pairs consisting of
137+
* corresponding elements of this $coll and `that`. The length
138+
* of the returned collection is the maximum of the lengths of this $coll and `that`.
139+
* If this $coll is shorter than `that`, `thisElem` values are used to pad the result.
140+
* If `that` is shorter than this $coll, `thatElem` values are used to pad the result.
137141
*/
138142
def zipAll[B, A1 >: A, That](that: GenIterable[B], thisElem: A1, thatElem: B)(implicit bf: CBF[Repr, (A1, B), That]): That
139143

src/library/scala/collection/GenMapLike.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ trait GenMapLike[A, +B, +Repr] extends GenIterableLike[(A, B), Repr] with Equals
4141
* @return the value associated with `key` if it exists,
4242
* otherwise the result of the `default` computation.
4343
* @usecase def getOrElse(key: A, default: => B): B
44+
* @inheritdoc
45+
* @tparam B the result type of the default computation.
4446
*/
4547
def getOrElse[B1 >: B](key: A, default: => B1): B1
4648

0 commit comments

Comments
 (0)