<!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 that the traversable to append.
* @tparam B the element type of the returned collection.
* @tparam That $thatinfo
* @param bf $bfinfo
* @return a new collection of type `That` which con
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
Java期末大作业 基于Java+JSP+Servlet实现的租车管理系统源码 Java期末大作业 基于Java+JSP+Servlet实现的租车管理系统源码 Java期末大作业 基于Java+JSP+Servlet实现的租车管理系统源码 Java期末大作业 基于Java+JSP+Servlet实现的租车管理系统源码 Java期末大作业 基于Java+JSP+Servlet实现的租车管理系统源码 Java期末大作业 基于Java+JSP+Servlet实现的租车管理系统源码 Java期末大作业 基于Java+JSP+Servlet实现的租车管理系统源码 Java期末大作业 基于Java+JSP+Servlet实现的租车管理系统源码 Java期末大作业 基于Java+JSP+Servlet实现的租车管理系统源码 Java期末大作业 基于Java+JSP+Servlet实现的租车管理系统源码 Java期末大作业 基于Java+JSP+Servlet实现的租车管理系统源码
资源推荐
资源详情
资源评论
收起资源包目录
Java期末大作业 基于Java+JSP+Servlet实现的租车管理系统源码 (761个子文件)
CarDao.class 6KB
Order.class 6KB
CustomerServlet.class 5KB
EmpDao.class 5KB
OrderDao.class 5KB
CustomerDao.class 5KB
CarServlet.class 5KB
OrderServlet.class 5KB
StoreDao.class 5KB
FindCarServlet.class 5KB
Car.class 4KB
EmpServlet(1).class 4KB
BrandDao.class 4KB
TxQueryRunner.class 4KB
StoreServlet.class 4KB
Emp.class 4KB
FindOrderServlet.class 3KB
FindAllEmpServlet.class 3KB
BaseServlet.class 3KB
CarbadServlet.class 3KB
Customer.class 3KB
LoginServlet.class 3KB
AddEmpServlet.class 3KB
GetStoreListServlet.class 2KB
MyUtils.class 2KB
BrandServlet.class 2KB
FindBrandServlet.class 2KB
MainServlet.class 2KB
FindAllStoreServlet.class 2KB
AccessFilter.class 2KB
AddStoreServlet.class 2KB
Store.class 2KB
JdbcUtils.class 2KB
CarbadDao.class 2KB
CustomerService.class 2KB
CarService.class 2KB
StoreService.class 2KB
EmpService.class 2KB
Carbad.class 2KB
PageBean.class 2KB
OrderService.class 2KB
Brand.class 2KB
CarbadService.class 1KB
BrandService.class 1KB
LoginDao.class 1KB
ExitServlet.class 1KB
Test.class 1KB
LoginService.class 609B
.classpath 604B
org.eclipse.wst.common.component 450B
org.eclipse.wst.jsdt.ui.superType.container 49B
summernote-bs3.css 143KB
style.css 134KB
bootstrap.min.css 118KB
animate.css 64KB
layui.css 50KB
datepicker3.css 33KB
font-awesome.css 32KB
bootstrap-rtl.css 31KB
font-awesome.min.css 26KB
ambiance.css 25KB
style.min.css 25KB
sweetalert.css 18KB
simditor.css 17KB
ui.jqgrid.css 16KB
layer.css 14KB
jasny-bootstrap.min.css 14KB
jquery-ui-1.10.4.custom.min.css 14KB
chosen.css 12KB
dropzone.css 11KB
layer.css 11KB
layim.css 11KB
fullcalendar.css 11KB
summernote.css 10KB
plyr.css 10KB
layui.mobile.css 10KB
webuploader-demo.css 7KB
laydate.css 7KB
codemirror.css 7KB
blueimp-gallery.min.css 7KB
awesome-bootstrap-checkbox.css 7KB
toastr.min.css 7KB
laydate.css 6KB
blueimp-gallery.css 6KB
jquery.steps.css 6KB
footable.core.css 5KB
jquery.fancybox.css 5KB
dataTables.bootstrap.css 5KB
bootstrap-table.min.css 4KB
clockpicker.css 4KB
basic.css 4KB
style.css 4KB
bootstrap-colorpicker.min.css 3KB
laydate.css 3KB
cropper.min.css 3KB
ion.rangeSlider.css 3KB
jquery.nouislider.css 3KB
layer.ext.css 3KB
bootstrap-markdown.min.css 3KB
blueimp-gallery-video.css 2KB
共 761 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
资源评论
- yangyiyiyiyiyiyi2023-06-06资源简直太好了,完美解决了当下遇到的难题,这样的资源很难不支持~
- 蒜蓉小龙虾4492023-06-12资源内容总结地很全面,值得借鉴,对我来说很有用,解决了我的燃眉之急。
- weixin_529843112024-01-24支持这个资源,内容详细,主要是能解决当下的问题,感谢大佬分享~
- 四号床2023-06-07发现一个宝藏资源,资源有很高的参考价值,赶紧学起来~
- m0_646328142023-12-28发现一个宝藏资源,资源有很高的参考价值,赶紧学起来~
柯晓楠
- 粉丝: 2w+
- 资源: 2847
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功