@mapgis/webclient-common
Version:
An important part of the MapGIS Client for JavaScript product, which provides interfaces and functions unrelated to the map engine.
2,631 lines (1,011 loc) • 195 kB
HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<script src="scripts/prettify/prettify.js"></script>
<script src="scripts/prettify/lang-css.js"></script>
<title> MapGIS Client for JavaScript API </title>
<script type="text/javascript">
</script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script src="scripts/jquery.min.js"></script>
<script src="scripts/adminlte/app.min.js"></script>
<link type="text/css" rel="stylesheet" href="styles/bootstrap.min.css">
<link type="text/css" rel="stylesheet" href="styles/adminlte/AdminLTE.min.css">
<link type="text/css" rel="stylesheet" href="styles/adminlte/skin-blue.min.css">
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/common.css">
<link type="text/css" rel="stylesheet" href="styles/header.css">
<link type="text/css" rel="stylesheet" href="styles/examples.css">
<link type="text/css" rel="stylesheet" href="styles/style.customize.css">
<link type="text/css" rel="stylesheet" href="styles/font-awesome.css">
<link type="text/css" rel="stylesheet" href="styles/jaguar.css">
<script src="scripts/bootstrap.min.js"></script>
</head>
<body class='sidebar-mini'>
<div id="wrap" class="clearfix">
<header class="header-wrapper main-header mapgis-header">
<nav class="navbar navbar-static-top lite">
<div class="nav-header">
<div class="navbar-header">
<div class="navbar-title" style="display: flex;align-items: center; ">
<a href="index.html">
<img class="mapgis-webclient-logo" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAACgCAYAAACLz2ctAAAACXBIWXMAAAsSAAALEgHS3X78AAAgAElEQVR42u2de3gb5Z3vv+/Yjp2rFF8Sx5atsRMgpbRWC7Q9tF2rfbYtpZQYKBRoS4aWpeFWD3DKluW0Hvd2oGnppKHAlpsMIaSwgF3ucHaR95xuT7cPi10O5ZL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GWDKGANt+KA+1gTD31wFd85l01AUxaiq97PlRfjpwiqhFI02LVbbvAmDz94EUe8y6aAKYtRd/pmlVfBvj33GkUaW69YEwKPNJi+nkmgAZDeM1zs+vLwW8cD/l5itZxiWreKRPAjIpw9TOivsaMtknnT599pj1+qennmQBm8eZ94+krQPQe7by8x7wbJoCmFKI1MW+BKSaAppgAmmKKCaApJoCmmJJN+f8yRATGNXIUUAAAAABJRU5ErkJggg==">
</a>
<a class="navbar-brand">
<span class="mapgis-webclient-text"> MapGIS Client for JavaScript(Common) </span>
</a>
<div id="suffix-title">for MapboxGL</div>
</div>
<button
type="button"
class="navbar-toggle collapsed"
data-toggle="collapse"
data-target="#navbar-collapse"
aria-expanded="false"
>
<i class="fa fa-bars"></i>
</button>
</div>
</div>
</nav>
</header>
<div class="navigationDiv">
</div>
<div class="main content-wrapper examples-container">
<h1 class="page-title" data-filename="Collection.html">Class: Collection</h1>
<section>
<header>
<h2></span>Collection
</h2>
</header>
<article>
<div class="container-overview">
<dt>
<div class="nameContainer">
<h4 class="name" id="Collection">
new Collection<span class="signature">(collection)</span>
</h4>
<div class="tag-source">
base/Collection.js, line 5
</div>
</div>
<p class="summary"><h5>支持如下方法:</h5>
<a href='#add'>[1、添加一个元素到集合中]</a><br/>
<a href='#add2'>[2、添加一个元素到集合中的指定位置]</a><br/>
<a href='#addMany'>[3、添加多个元素到集合中]</a><br/>
<a href='#addMany2'>[4、添加多个元素到集合中的指定位置]</a><br/>
<a href='#at'>[5、返回指定下标处的元素]</a><br/>
<a href='#clone'>[6、克隆并返回一个新集合对象]</a><br/>
<a href='#concat'>[7、将一个数组或者集合对象链接到当前集合对象末尾]</a><br/>
<a href='#every'>[8、检测数组所有元素是否都符合指定条件]</a><br/>
<a href='#filter'>[9、通过一个过滤条件(函数提供)来过滤并返回元素]</a><br/>
<a href='#find'>[10、返回第一个符合过滤条件(函数提供)的元素]</a><br/>
<a href='#findIndex'>[11、返回第一个符合过滤条件(函数提供)的元素的下标]</a><br/>
<a href='#flatten'>[12、扁平化一个集合对象]</a><br/>
<a href='#forEach'>[13、对集合中的所有元素执行传入的函数]</a><br/>
<a href='#getItemAt'>[14、获取指定下标的元素]</a><br/>
<a href='#includes'>[15、判断集合中是否包含该元素]</a><br/>
<a href='#indexOf'>[16、返回元素在集合中的下标]</a><br/>
<a href='#indexOf2'>[17、判断集合中是否包含该元素-选择起始下标]</a><br/>
<a href='#isCollection'>[18、判断传入的对象是否是一个集合对象]</a><br/>
<a href='#join'>[19、通过传入一个分隔符,将集合中的元素通过分隔符拼接成一个字符串并返回]</a><br/>
<a href='#lastIndexOf'>[20、从集合的最末尾开始,寻找该元素,并返回元素下标]</a><br/>
<a href='#lastIndexOf2'>[21、从集合的最末尾开始,寻找该元素,并返回元素下标 - 指定起始额位置]</a><br/>
<a href='#map'>[22、通过一个遍历函数来遍历该集合下的所有元素,并返回一个新集合对象]</a><br/>
<a href='#pop'>[23、删除并返回集合的最后一个元素]</a><br/>
<a href='#push[24、添加一个元素到集合中]</a><br/>
<a href='#reduce'>[25、接收一个函数做为累加器,将集合中的每一个元素(下标从小到大的顺序)进行累加,最后返回一个对象]</a><br/>
<a href='#reduceRight'>[26、接收一个函数做为累加器,将集合中的每一个元素(下标从大到小的顺序)进行累加,最后返回一个对象]</a><br/>
<a href='#remove'>[27、删除一个元素,仅会删除找到的第一个元素,并发送删除事件]</a><br/>
<a href='#removeAll'>[28、删除集合中的所有元素,删除完成后会发送数据变更事件]</a><br/>
<a href='#removeAt'>[29、删除指定下标的元素]</a><br/>
<a href='#removeMany'>[30、删除集合中的多个元素,删除完成后会发送数据变更事件]</a><br/>
<a href='#reorder'>[31、将指的元素调整到集合中指的下标位置]</a><br/>
<a href='#reverse'>[32、将集合对象中的元素反转,并返回新集合对象]</a><br/>
<a href='#shift'>[33、删除并返回集合的第一个元素]</a><br/>
<a href='#slice'>[34、截取集合中从start开始到end下标的元素,并返回一个新集合对象]</a><br/>
<a href='#some'>[35、判断集合对象中的元素是否满足过滤条件]</a><br/>
<a href='#sort'>[36、通过一个排序函数来对当前的集合进行排序,之后返回一个新集合对象,参考js的sort函数]</a><br/>
<a href='#splice'>[37、向集合中删除一个元素]</a><br/>
<a href='#splice2'>[38、向集合中添加一个元素]</a><br/>
<a href='#toArray'>[39、返回集合对象中元素组成的数组]</a><br/>
<a href='#unshift'>[40、向集合起始位置添加一个或多个元素]</a><br/>
<a href='#all'>[41、获取集合中的所有元素并返回一个数组]</a><br/>
<a href='#unique'>[42、去除集合中的重复元素]</a><br/>
<a href='#createInstance'>[43、创建实例]</a><br/></p>
</dt>
<dd>
<div class="description">
<p>集合类用来存储相同类型的项的数组,提供了大量的实用方法来处理集合中的元素,包括filter()、find()和reduce()等。<br>
集合中的元素可以是任何类型。例如,GraphicsLayer.graphics是存储在GraphicsLayer中的图形的集合。您可以使用Collection类中的方法来添加、删除、重新排序或操作GraphicsLayer中的图形。<br>
集合的另一个示例是Map.layers,它是所有地图的集合。</p>
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>collection</code></td>
<td class="type">
<span class="param-type">Array.<*></span>
</td>
<td class="description last">
<p>构造参数,要传入的元素数组</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Example</h5>
<p class="code-caption"><h7 id='Collection'>初始化一个集合对象</h7></p>
<pre class="prettyprint"><code>const collection = new Collection([1, 2, 3])</code></pre>
</dd>
</div>
<h3 class="subsection-title">Members</h3>
<dl>
<dt>
<div class="nameContainer">
<h4 class="name" id="items">items<span class="type-signature type array.<any>">Array.<any></span> </h4>
</div>
</dt>
<dd>
<div class="description">
<p>数组集合中的元素</p>
</div>
<dl class="details">
</dl>
</dd>
<dt>
<div class="nameContainer">
<h4 class="name" id="items">items<span class="type-signature type array.<any>">Array.<any></span> </h4>
</div>
</dt>
<dd>
<div class="description">
<p>items</p>
</div>
<dl class="details">
</dl>
</dd>
<dt>
<div class="nameContainer">
<h4 class="name" id="length">length<span class="type-signature type number">Number</span> </h4>
</div>
</dt>
<dd>
<div class="description">
<p>数组集合的长度</p>
</div>
<dl class="details">
</dl>
</dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<dl>
<dt>
<div class="nameContainer">
<h4 class="name" id=".isCollection">
Collection.isCollection<span class="signature">(item)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{Boolean}</span>
</h4>
<div class="tag-source">
base/Collection.js, line 405
</div>
</div>
</dt>
<dd>
<div class="description">
<p>判断传入的对象是否是一个集合对象</p>
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>item</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last">
<p>要判断的对象</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<table class="params">
<thead>
<tr>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="type">
Boolean
</td>
<td class="description last">是否是集合对象</td>
</tr>
</tbody>
</table>
<h5>Example</h5>
<p class="code-caption"><h7 id='isCollection'>判断传入的对象是否是一个集合对象</h7></p>
<pre class="prettyprint"><code>const collection = new Collection([1, 2, 3])
const isCollection = Collection.isCollection(collection)</code></pre>
</dd>
<dt>
<div class="nameContainer">
<h4 class="name" id="add">
add<span class="signature">(item, index)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{<a href="Collection.html">Collection</a>}</span>
</h4>
<div class="tag-source">
base/Collection.js, line 94
</div>
</div>
</dt>
<dd>
<div class="description">
<p>添加一个元素到集合中</p>
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>item</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last">
<p>要添加的元素</p></td>
</tr>
<tr>
<td class="name"><code>index</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">
<p>指的元素要添加的位置,如果不指定,默认添加到集合末尾</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<table class="params">
<thead>
<tr>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="type">
<a href="Collection.html">Collection</a>
</td>
<td class="description last">添加完元素后的集合对象</td>
</tr>
</tbody>
</table>
<h5>Examples</h5>
<p class="code-caption"><h7 id='add'>添加一个元素到集合中</h7></p>
<pre class="prettyprint"><code>const collection = new Collection()
collection.add({
key: 'value'
})</code></pre>
<p class="code-caption"><h7 id='add2'>添加一个元素到集合中的指定位置</h7></p>
<pre class="prettyprint"><code>const collection = new Collection([1, 2, 3])
collection.add({
key: 'value'
}, 1)</code></pre>
</dd>
<dt>
<div class="nameContainer">
<h4 class="name" id="addMany">
addMany<span class="signature">(items, index)</span>
</h4>
<div class="tag-source">
base/Collection.js, line 115
</div>
</div>
</dt>
<dd>
<div class="description">
<p>添加多个元素到集合中,添加完成后会发送数据变更事件</p>
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>items</code></td>
<td class="type">
<span class="param-type">Array.<*></span>
</td>
<td class="description last">
<p>要添加的多个元素</p></td>
</tr>
<tr>
<td class="name"><code>index</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">
<p>指的元素要添加的位置,如果不指定,默认添加到集合末尾</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Examples</h5>
<p class="code-caption"><h7 id='addMany'>添加多个元素到集合中</h7></p>
<pre class="prettyprint"><code>const collection = new Collection()
collection.addMany([1, 2, 3])</code></pre>
<p class="code-caption"><h7 id='addMany2'>添加多个元素到集合中的指定位置</h7></p>
<pre class="prettyprint"><code>const collection = new Collection([1, 2, 3])
collection.addMany([1, 2, 3], 2)</code></pre>
</dd>
<dt>
<div class="nameContainer">
<h4 class="name" id="all">
all<span class="signature">()</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{Array.<*>}</span>
</h4>
<div class="tag-source">
base/Collection.js, line 801
</div>
</div>
</dt>
<dd>
<div class="description">
<p>获取集合中的所有元素并返回一个数组</p>
</div>
<dl class="details">
</dl>
<h5>Returns:</h5>
<table class="params">
<thead>
<tr>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="type">
Array.<*>
</td>
<td class="description last">集合中元素构成的数组</td>
</tr>
</tbody>
</table>
<h5>Example</h5>
<p class="code-caption"><h7 id='toArray'>返回集合对象中元素组成的数组</h7></p>
<pre class="prettyprint"><code>const collection = new Collection([1, 2, 3])
collection.all()</code></pre>
</dd>
<dt>
<div class="nameContainer">
<h4 class="name" id="at">
at<span class="signature">(index)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{*}</span>
</h4>
<div class="tag-source">
base/Collection.js, line 140
</div>
</div>
</dt>
<dd>
<div class="description">
<p>返回指定下标处的元素</p>
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>index</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">
<p>元素下标,默认从0开始,允许使用正整数和负整数,负整数从集合中的最后一个元素开始倒数</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<table class="params">
<thead>
<tr>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="type">
*
</td>
<td class="description last">查询到的元素</td>
</tr>
</tbody>
</table>
<h5>Example</h5>
<p class="code-caption"><h7 id='at'>返回指定下标处的元素</h7></p>
<pre class="prettyprint"><code>const collection = new Collection([1, 2, 3])
const item = collection.at(1)</code></pre>
</dd>
<dt>
<div class="nameContainer">
<h4 class="name" id="clone">
clone<span class="signature">()</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{<a href="Collection.html">Collection</a>}</span>
</h4>
<div class="tag-source">
base/Collection.js, line 156
</div>
</div>
</dt>
<dd>
<div class="description">
<p>克隆并返回一个新集合对象</p>
</div>
<dl class="details">
</dl>
<h5>Returns:</h5>
<table class="params">
<thead>
<tr>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="type">
<a href="Collection.html">Collection</a>
</td>
<td class="description last">克隆后的集合对象</td>
</tr>
</tbody>
</table>
<h5>Example</h5>
<p class="code-caption"><h7 id='clone'>克隆并返回一个新集合对象</h7></p>
<pre class="prettyprint"><code>const collection = new Collection([1, 2, 3])
const cloneObj = collection.clone()</code></pre>
</dd>
<dt>
<div class="nameContainer">
<h4 class="name" id="concat">
concat<span class="signature">(collection)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{<a href="Collection.html">Collection</a>}</span>
</h4>
<div class="tag-source">
base/Collection.js, line 173
</div>
</div>
</dt>
<dd>
<div class="description">
<p>将一个数组或者集合对象链接到当前集合对象末尾</p>
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>collection</code></td>
<td class="type">
<span class="param-type">Array</span>
|
<span class="param-type"><a href="Collection.html">Collection</a></span>
</td>
<td class="description last">
<p>要链接的数组或者集合对象</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<table class="params">
<thead>
<tr>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="type">
<a href="Collection.html">Collection</a>
</td>
<td class="description last">链接后的新集合对象</td>
</tr>
</tbody>
</table>
<h5>Example</h5>
<p class="code-caption"><h7 id='concat'>将一个数组或者集合对象链接到当前集合对象末尾</h7></p>
<pre class="prettyprint"><code>const collection = new Collection([1, 2, 3])
collection.concat([{'a': 1}, {'b': 2}])
collection.concat(new Collection([4, 5, 6]))</code></pre>
</dd>
<dt>
<div class="nameContainer">
<h4 class="name" id="createInstance">
createInstance<span class="signature">(item)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{*}</span>
</h4>
<div class="tag-source">
base/Collection.js, line 868
</div>
</div>
</dt>
<dd>
<div class="description">
<p>创建实例,可由子类重载</p>
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>item</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last">
<p>要创建的实例对象</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<table class="params">
<thead>
<tr>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="type">
*
</td>
<td class="description last">创建的实例对象</td>
</tr>
</tbody>
</table>
</dd>
<dt>
<div class="nameContainer">
<h4 class="name" id="every">
every<span class="signature">(fn)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{Boolean}</span>
</h4>
<div class="tag-source">
base/Collection.js, line 206
</div>
</div>
</dt>
<dd>
<div class="description">
<p>检测数组所有元素是否都符合指定条件(通过函数提供)</p>
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>fn</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">
<p>过滤条件</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<table class="params">
<thead>
<tr>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="type">
Boolean
</td>
<td class="description last">是否全部满足过滤条件</td>
</tr>
</tbody>
</table>
<h5>Example</h5>
<p class="code-caption"><h7 id='every'>检测数组所有元素是否都符合指定条件</h7></p>
<pre class="prettyprint"><code>const collection = new Collection([1, 2, 3])
const isNumber = collection.every(function(item) {
return typeof item === 'number'
})</code></pre>
</dd>
<dt>
<div class="nameContainer">
<h4 class="name" id="filter">
filter<span class="signature">(fn)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{<a href="Collection.html">Collection</a>}</span>
</h4>
<div class="tag-source">
base/Collection.js, line 233
</div>
</div>
</dt>
<dd>
<div class="description">
<p>通过一个过滤条件(函数提供)来过滤并返回元素</p>
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>fn</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">
<p>过滤条件,如果过滤条件不是函数,则返回undefined</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<table class="params">
<thead>
<tr>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="type">
<a href="Collection.html">Collection</a>
</td>
<td class="description last">过滤后的新集合对象</td>
</tr>
</tbody>
</table>
<h5>Example</h5>
<p class="code-caption"><h7 id='filter'>通过一个过滤条件(函数提供)来过滤并返回元素</h7></p>
<pre class="prettyprint"><code>const collection = new Collection([1, 2, 3, 4, 5])
const newCollection = collection.filter(function(item) {
return item > 2
})</code></pre>
</dd>
<dt>
<div class="nameContainer">
<h4 class="name" id="find">
find<span class="signature">(fn)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{*}</span>
</h4>
<div class="tag-source">
base/Collection.js, line 257
</div>
</div>
</dt>
<dd>
<div class="description">
<p>返回第一个符合过滤条件(函数提供)的元素,如果没找到则返回undefined</p>
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>fn</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">
<p>过滤条件,如果过滤条件不是函数,也返回undefined</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<table class="params">
<thead>
<tr>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="type">
*
</td>
<td class="description last">第一个符合过滤条件的元素</td>
</tr>
</tbody>
</table>
<h5>Example</h5>
<p class="code-caption"><h7 id='find'>返回第一个符合过滤条件(函数提供)的元素,如果没找到则返回undefined</h7></p>
<pre class="prettyprint"><code>const collection = new Collection([1, 2, 3, 4, 5])
const item = collection.find(function(item) {
return item > 2
})</code></pre>
</dd>
<dt>
<div class="nameContainer">
<h4 class="name" id="findIndex">
findIndex<span class="signature">(fn)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{Number}</span>
</h4>
<div class="tag-source">
base/Collection.js, line 282
</div>
</div>
</dt>
<dd>
<div class="description">
<p>返回第一个符合过滤条件(函数提供)的元素的下标,如果没找到则返回-1</p>
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>fn</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">
<p>过滤条件</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<table class="params">
<thead>
<tr>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="type">
Number
</td>
<td class="description last">第一个符合过滤条件(函数提供)的元素的下标</td>
</tr>
</tbody>
</table>
<h5>Example</h5>
<p class="code-caption"><h7 id='findIndex'>返回第一个符合过滤条件(函数提供)的元素的下标,如果没找到则返回-1</h7></p>
<pre class="prettyprint"><code>const collection = new Collection([1, 2, 3, 4, 5])
const index = collection.findIndex(function(item) {
return item > 1
})</code></pre>
</dd>
<dt>
<div class="nameContainer">
<h4 class="name" id="flatten">
flatten<span class="signature">(fn)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{<a href="Collection.html">Collection</a>}</span>
</h4>
<div class="tag-source">
base/Collection.js, line 300
</div>
</div>
</dt>
<dd>
<div class="description">
<p>扁平化一个集合对象,通过传入的扁平化函数来指定要扁平化的对象数组,直到指定的对象数组为空或者元素数量为0,之后返回一个新集合对象</p>
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>fn</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">
<p>扁平化函数,通过该函数来指定要扁平化的对象数组,如果该函数不是一个函数对象,则返回undefined</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<table class="params">
<thead>
<tr>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="type">
<a href="Collection.html">Collection</a>
</td>
<td class="description last">扁平化后的集合对象</td>
</tr>
</tbody>
</table>
<h5>Example</h5>
<p class="code-caption"><h7 id='flatten'>扁平化一个集合对象</h7></p>
<pre class="prettyprint"><code>const collection = new Collection([{
layers: [1, 2, 3]
},{
items: [4, 5, 6]
}])
const flatten = collection.flatten(function(item) {
return item.layers || item.items
})</code></pre>
</dd>
<dt>
<div class="nameContainer">
<h4 class="name" id="forEach">
forEach<span class="signature">(fn)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{<a href="Collection.html">Collection</a>}</span>
</h4>
<div class="tag-source">
base/Collection.js, line 347
</div>
</div>
</dt>
<dd>
<div class="description">
<p>对集合中的所有元素执行传入的函数</p>
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>fn</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">
<p>针对元素的执行函数,参考js数组的forEach方法</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<table class="params">
<thead>
<tr>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="type">
<a href="Collection.html">Collection</a>
</td>
<td class="description last">执行完函数后的集合对象</td>
</tr>
</tbody>
</table>
<h5>Example</h5>
<p class="code-caption"><h7 id='forEach'>对集合中的所有元素执行传入的函数</h7></p>
<pre class="prettyprint"><code>const collection = new Collection([1, 2, 3])
collection.forEach(function(item) {
console.log("item:", item)
})</code></pre>
</dd>
<dt>
<div class="nameContainer">
<h4 class="name" id="getItemAt">
getItemAt<span class="signature">(index)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{*}</span>
</h4>
<div class="tag-source">
base/Collection.js, line 359
</div>
</div>
</dt>
<dd>
<div class="description">
<p>获取指定下标的元素,没找到则返回undefined</p>
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>index</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">
<p>元素下标</p></td>
</tr>
</tbody>
</table>
<dl class="details">