8000 Add overrides to scm.Buffer, for tracking. · scala-js/scala-js@e4b4fea · GitHub
[go: up one dir, main page]

Skip to content

Commit e4b4fea

Browse files
committed
Add overrides to scm.Buffer, for tracking.
1 parent b6d66e3 commit e4b4fea

File tree

2 files changed

+97
-0
lines changed

2 files changed

+97
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/* __ *\
2+
** ________ ___ / / ___ Scala API **
3+
** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL **
4+
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
5+
** /____/\___/_/ |_/____/_/ | | **
6+
** |/ **
7+
\* */
8+
9+
10+
11+
package scala.collection
12+
package mutable
13+
14+
import generic._
15+
16+
/** Buffers are used to create sequences of elements incrementally by
17+
* appending, prepending, or inserting new elements. It is also
18+
* possible to access and modify elements in a random access fashion
19+
* via the index of the element in the current sequence.
20+
*
21+
* @author Matthias Zenger
22+
* @author Martin Odersky
23+
* @version 2.8
24+
* @since 1
25+
*
26+
* @tparam A type of the elements contained in this buffer.
27+
*
28+
* @define Coll `Buffer`
29+
* @define coll buffer
30+
*/
31+
trait Buffer[A] extends Seq[A]
32+
with GenericTraversableTemplate[A, Buffer]
33+
with BufferLike[A, Buffer[A]]
34+
with scala.Cloneable {
35+
override def companion: GenericCompanion[Buffer] = Buffer
36+
}
37+
38+
/** $factoryInfo
39+
* @define coll buffer
40+
* @define Coll `Buffer`
41+
*/
42+
object Buffer extends SeqFactory[Buffer] {
43+
implicit def canBuildFrom[A]: CanBuildFrom[Coll, A, Buffer[A]] = ReusableCBF.asInstanceOf[GenericCanBuildFrom[A]]
44+
def newBuilder[A]: Builder[A, Buffer[A]] = new ArrayBuffer
45+
}
46+
47+
/** Explicit instantiation of the `Buffer` trait to reduce class file size in subclasses. */
48+
private[scala] abstract class AbstractBuffer[A] extends AbstractSeq[A] with Buffer[A]
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/* __ *\
2+
** ________ ___ / / ___ Scala API **
3+
** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL **
4+
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
5+
** /____/\___/_/ |_/____/_/ | | **
6+
** |/ **
7+
\* */
8+
9+
10+
11+
package scala
12+
package collection
13+
package mutable
14+
15+
import generic._
16+
17+
/** Buffers are used to create sequences of elements incrementally by
18+
* appending, prepending, or inserting new elements. It is also
19+
* possible to access and modify elements in a random access fashion
20+
* via the index of the element in the current sequence.
21+
*
22+
* @author Matthias Zenger
23+
* @author Martin Odersky
24+
* @version 2.8
25+
* @since 1
26+
*
27+
* @tparam A type of the elements contained in this buffer.
28+
*
29+
* @define Coll `Buffer`
30+
* @define coll buffer
31+
*/
32+
trait Buffer[A] extends Seq[A]
33+
with GenericTraversableTemplate[A, Buffer]
34+
with BufferLike[A, Buffer[A]]
35+
with scala.Cloneable {
36+
override def companion: GenericCompanion[Buffer] = Buffer
37+
}
38+
39+
/** $factoryInfo
40+
* @define coll buffer
41+
* @define Coll `Buffer`
42+
*/
43+
object Buffer extends SeqFactory[Buffer] {
44+
implicit def canBuildFrom[A]: CanBuildFrom[Coll, A, Buffer[A]] = ReusableCBF.asInstanceOf[GenericCanBuildFrom[A]]
45+
def newBuilder[A]: Builder[A, Buffer[A]] = new ArrayBuffer
46+
}
47+
48+
/** Explicit instantiation of the `Buffer` trait to reduce class file size in subclasses. */
49+
abstract class AbstractBuffer[A] extends AbstractSeq[A] with Buffer[A]

0 commit comments

Comments
 (0)
0