-
-
Add a datasource to the collection.
Name |
Type |
Description |
dataSource |
DataSource
|
Promise.<DataSource>
|
The datasource to be added or the promise of the datasource. After the promise is successfully resolved, the datasource is added to the collection. |
Returns:
The datasource is added to the resolved promise in the collection.
-
contains(dataSource) → Boolean
-
Check whether the specified datasource is included in the collection.
Name |
Type |
Description |
dataSource |
DataSource
|
The datasource to be retrieved. |
Returns:
If true is included in the set, return true, otherwise return false.
-
-
Release the resources occupied by all datasources in the collection. Once the object resource is released, it cannot be used; calling any method will throw an
DeveloperError
exception.
Throws:
Example:
dataSourceCollection = dataSourceCollection && dataSourceCollection.destroy();
See:
-
-
Get the datasource of the specified index in the collection.
Name |
Type |
Description |
index |
Number
|
The specified index number. |
Returns:
datasource.
-
indexOf(dataSource) → Number
-
Determine the index number of the specified datasource in the collection.
Name |
Type |
Description |
dataSource |
DataSource
|
The datasource to be retrieved. |
Returns:
The index number of the datasource in the collection. If the collection does not contain the datasource, return -1.
-
-
It returns true if the object is destroyed, otherwise it returns false. Once the object resource is released, it cannot be used; calling any method will throw an
DeveloperError
exception.
Returns:
See:
-
remove(dataSource, destroy) → Boolean
-
Remove a datasource from the collection.
Name |
Type |
Default |
Description |
dataSource |
DataSource
|
|
The datasource to be removed. |
destroy |
Boolean
|
false
|
optional
Specify whether to destroy the datasource after removal. |
Returns:
After the datasource in the collection is removed, true is returned; if the datasource does not exist in the collection, the removal fails and false is returned.
-
-
Remove all datasources in the collection.
Name |
Type |
Default |
Description |
destroy |
Boolean
|
false
|
optional
Specify whether to destroy the datasource after removal. |