Non-destructively composites multiple
EntityCollection instances into a single collection.
If a Entity with the same ID exists in multiple collections, it is non-destructively
合并为一个新的实体实例。 如果一个实体在多个财产中拥有相同的财产
collections, the property of the Entity in the last collection of the list it
属于它。 复合实体集合几乎可以用于任何地方,即
使用了实体收集.
| Name | Type | Description |
|---|---|---|
collections |
Array.<EntityCollection> | optional 要合并的实体集合实例的初始列表 . |
owner |
DataSource | CompositeEntityCollection | optional 创建此集的数据源(或复合实体集). |
Members
readonly collectionChanged : Event
获取当实体被添加或从收藏中移除时被发射的事件.
生成的事件为
EntityCollection.collectionChangedEventCallback .
获取此收藏的全球独有标识符 .
readonly owner : DataSource|CompositeEntityCollection
获得此复合实体收藏的拥有者 。 创建该数据库的数据源或复合实体的收集.
readonly values : Array.<Entity>
Gets the array of Entity instances in the collection.
此数组不应直接修改 .
Methods
将收藏添加到复合材料中.
| Name | Type | Description |
|---|---|---|
collection |
EntityCollection | 要添加的收藏. |
index |
number | optional 用于添加收藏的索引。 如果省略, 收藏会 在全部现有收藏之上添加. |
Throws:
-
DeveloperError : index, if supplied, must be greater than or equal to zero and less than or equal to the number of collections.
computeAvailability() → TimeInterval
计算收藏中实体的最大可用性.
如果收集中包含无限可得数据和非无限数据的组合,
它只返回与非无限数据有关的间隔 。 如果有的话
数据是无限的,将返回一个无限的间隔.
Returns:
收藏中实体的有无.
如果提供的实体在此收藏中, 则返回真实性, 否则是虚假的 .
| Name | Type | Description |
|---|---|---|
entity |
Entity | The entity. |
Returns:
如果所提供实体在此集合中,则不实.
检查是否包含给定的收藏 .
| Name | Type | Description |
|---|---|---|
collection |
EntityCollection | 要检查的收藏 . |
Returns:
如果复合材料包含收藏,则真实无误.
getById(id) → Entity|undefined
获取带有指定标识的实体.
| Name | Type | Description |
|---|---|---|
id |
string | 取回实体的ID. |
Returns:
如果收藏中id不存在,则提供id或未定义的实体.
从复合材料中获得按索引分类的集合.
| Name | Type | Description |
|---|---|---|
index |
number | 用于检索的索引. |
获取此复合材料中的收藏数量 .
确定复合材料中给定的集合的索引.
| Name | Type | Description |
|---|---|---|
collection |
EntityCollection | 查找索引的集合 . |
Returns:
复合体中集合物的索引,或者如果复合体中集合物不存在的 -1.
在复合材料中,将一个收藏降低一个位置.
| Name | Type | Description |
|---|---|---|
collection |
EntityCollection | 要移动的集合 . |
Throws:
-
DeveloperError : collection is not in this composite.
将收藏降低到复合材料的底部.
| Name | Type | Description |
|---|---|---|
collection |
EntityCollection | 要移动的集合 . |
Throws:
-
DeveloperError : collection is not in this composite.
在复合材料中提高一个位置.
| Name | Type | Description |
|---|---|---|
collection |
EntityCollection | 要移动的集合 . |
Throws:
-
DeveloperError : collection is not in this composite.
将收藏提升到复合材料的顶端.
| Name | Type | Description |
|---|---|---|
collection |
EntityCollection | 要移动的集合 . |
Throws:
-
DeveloperError : collection is not in this composite.
从此复合材料中删除所有收藏.
从此复合材料中删除收藏,如果存在的话.
| Name | Type | Description |
|---|---|---|
collection |
EntityCollection | 集应除. |
Returns:
如果收藏品在复合材料中被删除,那就是真的,
如果收藏不在复合体中,则不真实.
Resumes raising
EntityCollection#collectionChanged events immediately
当某一项被添加或删除时。 活动暂停期间所作的任何修改
当调用此函数时, 将会作为单个事件触发。 该职能还确保
如果事件也恢复,则重新合并收藏.
此函数被计算为参考, 只要有, 可以安全地调用多次
are corresponding calls to EntityCollection#resumeEvents.
Throws:
-
DeveloperError : resumeEvents can not be called before suspendEvents.
Prevents
EntityCollection#collectionChanged events from being raised
until a corresponding call is made to EntityCollection#resumeEvents, at which
点将提出一个涵盖所有暂停操作的事件.
这样可以有效地添加和删除许多项目.
在暂停活动的同时,将重新整理收藏品
还暂停,因为这可能是一项代价高昂的行动.
只要有, 此函数可以安全调用多次
are corresponding calls to EntityCollection#resumeEvents.