<!doctype html>
<title>CodeMirror: Scala mode</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="../../doc/docs.css">
<link rel="stylesheet" href="../../lib/codemirror.css">
<link rel="stylesheet" href="../../theme/ambiance.css">
<script src="../../lib/codemirror.js"></script>
<script src="../../addon/edit/matchbrackets.js"></script>
<script src="clike.js"></script>
<div id=nav>
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
<ul>
<li><a href="../../index.html">Home</a>
<li><a href="../../doc/manual.html">Manual</a>
<li><a href="https://github.com/codemirror/codemirror">Code</a>
</ul>
<ul>
<li><a href="../index.html">Language modes</a>
<li><a class=active href="#">Scala</a>
</ul>
</div>
<article>
<h2>Scala mode</h2>
<form>
<textarea id="code" name="code">
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2011, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
package scala.collection
import generic._
import mutable.{ Builder, ListBuffer }
import annotation.{tailrec, migration, bridge}
import annotation.unchecked.{ uncheckedVariance => uV }
import parallel.ParIterable
/** A template trait for traversable collections of type `Traversable[A]`.
*
* $traversableInfo
* @define mutability
* @define traversableInfo
* This is a base trait of all kinds of $mutability Scala collections. It
* implements the behavior common to all collections, in terms of a method
* `foreach` with signature:
* {{{
* def foreach[U](f: Elem => U): Unit
* }}}
* Collection classes mixing in this trait provide a concrete
* `foreach` method which traverses all the
* elements contained in the collection, applying a given function to each.
* They also need to provide a method `newBuilder`
* which creates a builder for collections of the same kind.
*
* A traversable class might or might not have two properties: strictness
* and orderedness. Neither is represented as a type.
*
* The instances of a strict collection class have all their elements
* computed before they can be used as values. By contrast, instances of
* a non-strict collection class may defer computation of some of their
* elements until after the instance is available as a value.
* A typical example of a non-strict collection class is a
* <a href="../immutable/Stream.html" target="ContentFrame">
* `scala.collection.immutable.Stream`</a>.
* A more general class of examples are `TraversableViews`.
*
* If a collection is an instance of an ordered collection class, traversing
* its elements with `foreach` will always visit elements in the
* same order, even for different runs of the program. If the class is not
* ordered, `foreach` can visit elements in different orders for
* different runs (but it will keep the same order in the same run).'
*
* A typical example of a collection class which is not ordered is a
* `HashMap` of objects. The traversal order for hash maps will
* depend on the hash codes of its elements, and these hash codes might
* differ from one run to the next. By contrast, a `LinkedHashMap`
* is ordered because it's `foreach` method visits elements in the
* order they were inserted into the `HashMap`.
*
* @author Martin Odersky
* @version 2.8
* @since 2.8
* @tparam A the element type of the collection
* @tparam Repr the type of the actual collection containing the elements.
*
* @define Coll Traversable
* @define coll traversable collection
*/
trait TraversableLike[+A, +Repr] extends HasNewBuilder[A, Repr]
with FilterMonadic[A, Repr]
with TraversableOnce[A]
with GenTraversableLike[A, Repr]
with Parallelizable[A, ParIterable[A]]
{
self =>
import Traversable.breaks._
/** The type implementing this traversable */
protected type Self = Repr
/** The collection of type $coll underlying this `TraversableLike` object.
* By default this is implemented as the `TraversableLike` object itself,
* but this can be overridden.
*/
def repr: Repr = this.asInstanceOf[Repr]
/** The underlying collection seen as an instance of `$Coll`.
* By default this is implemented as the current collection object itself,
* but this can be overridden.
*/
protected[this] def thisCollection: Traversable[A] = this.asInstanceOf[Traversable[A]]
/** A conversion from collections of type `Repr` to `$Coll` objects.
* By default this is implemented as just a cast, but this can be overridden.
*/
protected[this] def toCollection(repr: Repr): Traversable[A] = repr.asInstanceOf[Traversable[A]]
/** Creates a new builder for this collection type.
*/
protected[this] def newBuilder: Builder[A, Repr]
protected[this] def parCombiner = ParIterable.newCombiner[A]
/** Applies a function `f` to all elements of this $coll.
*
* Note: this method underlies the implementation of most other bulk operations.
* It's important to implement this method in an efficient way.
*
*
* @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
*/
def foreach[U](f: A => U): Unit
/** Tests whether this $coll is empty.
*
* @return `true` if the $coll contain no elements, `false` otherwise.
*/
def isEmpty: Boolean = {
var result = true
breakable {
for (x <- this) {
result = false
break
}
}
result
}
/** Tests whether this $coll is known to have a finite size.
* All strict collections are known to have finite size. For a non-strict collection
* such as `Stream`, the predicate returns `true` if all elements have been computed.
* It returns `false` if the stream is not yet evaluated to the end.
*
* Note: many collection methods will not work on collections of infinite sizes.
*
* @return `true` if this collection is known to have finite size, `false` otherwise.
*/
def hasDefiniteSize = true
def ++[B >: A, That](that: GenTraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
val b = bf(repr)
if (that.isInstanceOf[IndexedSeqLike[_, _]]) b.sizeHint(this, that.seq.size)
b ++= thisCollection
b ++= that.seq
b.result
}
@bridge
def ++[B >: A, That](that: TraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That =
++(that: GenTraversableOnce[B])(bf)
/** Concatenates this $coll with the elements of a traversable collection.
* It differs from ++ in that the right operand determines the type of the
* resulting collection rather than the left one.
*
* @param th
没有合适的资源?快使用搜索试试~ 我知道了~
仿淘宝B站购物直播+微信小程序+带货完整PHP源码
共2000个文件
php:1057个
png:608个
js:580个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 49 浏览量
2022-02-16
15:44:21
上传
评论
收藏 37.78MB ZIP 举报
温馨提示
直播商城将深度的挖掘内容 电商的需求(内容:短视频带货,自媒体入驻文章带货,洋淘秀等具有强烈社交属性的带货方式等KOL电商运营模式)逐渐完善特色的社交电商生态。 修复直播间相关问题; 商品新建,保存标签问题修复;
资源推荐
资源详情
资源评论
收起资源包目录
仿淘宝B站购物直播+微信小程序+带货完整PHP源码 (2000个子文件)
0042e171ffcbae89bf7e86ba90c0e4a1797f3bd0 14B
00cbe598981e996b80736ae3543feddc2920e57f 14B
00d1a83dd9cb36663285860899825f87e79405be 14B
01262f2aefd8accbad0366496752e0bbafb54b44 14B
01cf7c808be3af38f92e83618d881907fee99cf6 14B
01ea5e256299f0c8c72b57c30c6b5b50608d7158 14B
0252fa65902862754b2480d8b411b893ec452562 14B
026968facc34739a0969d9952a8b5d27edf6d718 14B
026e671148a6a24e42ff0f1098cd7e4fbd6fcf14 14B
02a052f4660ca96ca5a6bb786682c02a7754eccb 14B
02f39d5a07a23ba980f1e24e93b3c383dbc2b579 14B
0316b054fec4c214ce27311e2771b637f2cbc3c7 243B
033940f2582d1b6e9b2f9e62bb15e25d4c7a4896 14B
03e66d9a0f4c515662e2920329ace4763dd6cb13 14B
043d3c69b9b363a3f4c8f7537f90e0dd1fac1e6a 14B
0444640226eb26b35b5c7add1bb6f1a5edb7ca3e 14B
044b2ac15c4ec5fbbc7374c13c356851d0aa646d 14B
04822a493d7cf5d1277ed163ea879b681d0886af 14B
048a45acbd422fc9b5d00d1cab259f46dcbd3de3 14B
0498cbbd52d19b5bb517faefa3f8ccc63aced79d 14B
04c9a96c811e91640118e4c938f5dab31feec7ac 14B
04d24ece4effd6433db368ab482a1e357f1a62e0 14B
04f11ebfedc7e87be4170896f6035225ae28f067 14B
0559b7be7dfbf92116b0f54b9ca51b7d5065fa26 14B
055e1279895ad1cb1a3115d510938a12c80c5c53 14B
056f293adb40cfe7dbfb62b5624239b63f78a4e7 14B
057554e51ca3a3198bb51fab93c1a14c6096543a 14B
05e1849c73dd03e47d850d949831f6786f23e341 14B
0637b8e4346c8a79927c764ad931d4da685fa3fa 14B
067d42c61a76d5fa85a9c312071772b6dbebd3fa 14B
06afc84b194a0c8aaade04c211d7a1edc68a43bb 14B
06e8959f2c968b5af81acc781f1e430a13b00ab5 14B
070d3dcc9dbbf8e6369c7f2c01607cbb67cbde48 14B
0788421d2d85a89a27604165d38e48d847189179 14B
07b25d86bbd46b3ef7ff7dffb3712a8d4ec639b3 14B
07c431e0c04d585984bc0014a0069f996d963908 14B
08001b13e8bc0d13aea2a74639be9dd97f91d7bd 14B
082da46fce558c450bd3ebd5a2e8128ef6a0715d 14B
0899a8eb37617f7e72719a001bcfb1873da5ebd8 14B
08b28893f23005e338ea2f8e0edce43ee917c14f 14B
09114fa678d8c4aad6ee3aeb6b75e20179b783f8 14B
09866d49606aefd7a194738013fdc2f7d5414202 14B
09cca98f4092cf84071562d2c0764ac539ae1bef 14B
09fb94530853f470dc163b5795a87cc97bb55944 14B
0a1bbc29db5ae4d0330e3cba654b8cb58855605f 14B
0a2c5ea8b1135a941e48577cddb90916e7efbb42 14B
0a3e6b0ac70bcf59b2c82d466c2c9e49eada9ab5 14B
0a8c71487f1a35c76297b100d89b3c7bef15faf4 14B
0a9afef1f3a7778ef6e152baa3dbe2875151e145 14B
0b09afb7e6607552f0fc25f1b93c4ca539de5242 14B
0b0bdb5245bc1718e95b04febd5944da0856dca2 14B
0b219f1553b38b426d6e2d704478eabba0d77bc6 14B
0b2e33f71891dacc67d21bcb8c5f814eff56da66 14B
0b91503a85098566f14b3ba9ce9e2b962eb7df6c 14B
0bcb1d3d3921331416144153f0a3639ba25999b5 14B
0be39f8b15ccd6c2cf69e070662cc440b1be8933 14B
0be72c18f5f04c0f6eb85b618d4177bbac210ff0 14B
0bf0582b4a8fb5b97f2cc76a27e09241b0d1aed8 14B
0c2b8fb270cda15ad3594041c7b710f2a37aea92 14B
0c643166b435895b74b43d6f59e9e6efef46ab66 14B
0c8cc8aef969f49ec2afb39d6398d930844c5689 14B
0d1decc0bd6cfcfe6583942a397f542b29b0d1ae 14B
0d2c5c99b343fbf99080756a4d72bfa1ca60ddf6 19B
0e1514c87866ae9ca7a73c47b9bfa336cde83522 14B
0e33e642d446da11a0ff411013e3d5c8882fbfa6 14B
0eddd1a2f424a2c9bcdff3d58362b9da84a22d05 14B
0f40cc39eeb49fa1b954e848651e898805d9b020 14B
0f965589a1e77f898d1f1338b78af1f7888f6eb2 14B
0fa6766eaa3268853ef2c0c6083b2ea642279a9a 14B
0fbe7c636d129526f4cac21b6d479f07a1c63102 14B
1014759856d8899f17d659f05957ce344ee03c9e 14B
102305b1e08b12246cdec8722cb3b3ec246e5ecf 14B
102787b7876eee3bdd9a21a1fc2cad0bd4412bf9 14B
102e0cd4ef89389fba094e29eb05aee2266d16fd 14B
103578abbed953ca8230b934ded6977c262769f8 14B
1042022024106d6f5aa3b61d7b482e596707aebb 14B
10d9a1d135bc87fd1809dc56f20af29494f46111 14B
11060bc3de54021f66dc96a211ff8dd819042353 14B
113509ab3aea04a2dfd58533cebf13038ee48e79 14B
117474f157ed5c63fab7b183bc9abc3afed73b82 14B
11cc127d1460b9cadbadf347de8b0f861b61160d 14B
124c27cde885a4d3d53efb99ace37a5375b38661 14B
125d1e62e28e315e498f26765fa0030cc84363ac 14B
12ef35e154b18c44bd314e0bc497bcc0c2ebaa73 14B
133abf4a06709f2d9c4fae91d7dac8ba8c78538b 14B
1350356805c2a54fc2d9b7e620d18801379f0d6c 14B
13a82e53763b783f13f2bf7f94cb29a9decc5c15 14B
13b328b5c5827150edb53f8f5379819e7d146e9a 14B
13e67ee11b88558db152a602e139599e965a0f94 14B
13fe41bcb19cc35b29ee749145712c01e95754df 14B
147521015ed551249bf0eec9503e1c8026678f0d 14B
149cdb5fb233784f73a914f7a97971c40d814de6 14B
159d487d96711319a9cbe376a4f7bf7bb75d75c9 14B
15be56f07e567b25d8624eb9872fe1d7cab0990e 14B
1662702ca598a1af02044320b1941c943927cdd3 14B
168a3a7de8bbdacef5c459dff56d6bcb4302d6f0 14B
16ad5ee9597b94126e58f965014c36d1c6980992 14B
16bc487f935e7d2a8b780f5fc4bc34064ecf2f09 14B
16dd20d2b1504e83c5c7688f1187884730952f50 14B
16eef1b9a22f50fc042ef1a01d825b682f9ca2d7 14B
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
智慧浩海
- 粉丝: 1w+
- 资源: 5145
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功