@JsType(isNative=true, namespace="Cesium", name="CompositeEntityCollection") public class CompositeEntityCollection extends Object
Constructor and Description |
---|
CompositeEntityCollection()
Non-destructively composites multiple
EntityCollection instances into a single collection. |
CompositeEntityCollection(EntityCollection[] collections)
Non-destructively composites multiple
EntityCollection instances into a single collection. |
CompositeEntityCollection(EntityCollection[] collections,
CompositeEntityCollection owner)
Non-destructively composites multiple
EntityCollection instances into a single collection. |
CompositeEntityCollection(EntityCollection[] collections,
DataSource owner)
Non-destructively composites multiple
EntityCollection instances into a single collection. |
Modifier and Type | Method and Description |
---|---|
void |
addCollection(EntityCollection collection)
Adds a collection to the composite.
|
void |
addCollection(EntityCollection collection,
int index)
Adds a collection to the composite.
|
Event |
collectionChanged()
Gets the event that is fired when entities are added or removed from the collection.
|
TimeInterval |
computeAvailability()
Computes the maximum availability of the entities in the collection.
|
boolean |
contains(Entity entity)
Returns true if the provided entity is in this collection, false otherwise.
|
boolean |
containsCollection(EntityCollection collection)
Checks to see if the composite contains a given collection.
|
Entity |
getById(Object id)
Gets an entity with the specified id.
|
EntityCollection |
getCollection(int index)
Gets a collection by index from the composite.
|
int |
getCollectionsLength()
Gets the number of collections in this composite.
|
String |
id()
Gets a globally unique identifier for this collection.
|
int |
indexOfCollection(EntityCollection collection)
Determines the index of a given collection in the composite.
|
void |
lowerCollection(EntityCollection collection)
Lowers a collection down one position in the composite.
|
void |
lowerCollectionToBottom(EntityCollection collection)
Lowers a collection to the bottom of the composite.
|
Object |
owner()
Gets the owner of this entity collection, ie. the data source or composite entity collection which created it.
|
void |
raiseCollection(EntityCollection collection)
Raises a collection up one position in the composite.
|
void |
raiseCollectionToTop(EntityCollection collection)
Raises a collection to the top of the composite.
|
void |
removeAllCollections()
Removes all collections from this composite.
|
boolean |
removeCollection(EntityCollection collection)
Removes a collection from this composite, if present.
|
void |
resumeEvents()
Resumes raising
EntityCollection.collectionChanged() events immediately when an item is added or removed. |
void |
suspendEvents()
Prevents
EntityCollection.collectionChanged() events from being raised until a corresponding call is made
to EntityCollection.resumeEvents() , at which point a single event will be raised that covers all
suspended operations. |
Entity[] |
values()
Gets the array of Entity instances in the collection.
|
@JsConstructor public CompositeEntityCollection()
EntityCollection
instances into a single collection. If a Entity with the
same ID exists in multiple collections, it is non-destructively merged into a single new entity instance.
If an entity has the same property in multiple collections, the property of the Entity in the last collection of
the list it belongs to is used. CompositeEntityCollection can be used almost anywhere that a EntityCollection is used.@JsConstructor public CompositeEntityCollection(EntityCollection[] collections)
EntityCollection
instances into a single collection. If a Entity with the
same ID exists in multiple collections, it is non-destructively merged into a single new entity instance.
If an entity has the same property in multiple collections, the property of the Entity in the last collection of
the list it belongs to is used. CompositeEntityCollection can be used almost anywhere that a EntityCollection is used.collections
- The initial list of EntityCollection instances to merge.@JsConstructor public CompositeEntityCollection(EntityCollection[] collections, DataSource owner)
EntityCollection
instances into a single collection. If a Entity with the
same ID exists in multiple collections, it is non-destructively merged into a single new entity instance.
If an entity has the same property in multiple collections, the property of the Entity in the last collection of
the list it belongs to is used. CompositeEntityCollection can be used almost anywhere that a EntityCollection is used.collections
- The initial list of EntityCollection instances to merge.owner
- The data source (or composite entity collection) which created this collection.@JsConstructor public CompositeEntityCollection(EntityCollection[] collections, CompositeEntityCollection owner)
EntityCollection
instances into a single collection. If a Entity with the
same ID exists in multiple collections, it is non-destructively merged into a single new entity instance.
If an entity has the same property in multiple collections, the property of the Entity in the last collection of
the list it belongs to is used. CompositeEntityCollection can be used almost anywhere that a EntityCollection is used.collections
- The initial list of EntityCollection instances to merge.owner
- The data source (or composite entity collection) which created this collection.@JsProperty(name="collectionChanged") public Event collectionChanged()
@JsProperty(name="id") public String id()
@JsProperty(name="owner") public Object owner()
@JsProperty(name="values") public Entity[] values()
@JsMethod public void addCollection(EntityCollection collection)
collection
- the collection to add.@JsMethod public void addCollection(EntityCollection collection, int index)
collection
- the collection to add.index
- the index to add the collection at. If omitted, the collection will added on top of all existing collections.@JsMethod public TimeInterval computeAvailability()
@JsMethod public boolean contains(Entity entity)
entity
- The entity.@JsMethod public boolean containsCollection(EntityCollection collection)
collection
- the collection to check for.public Entity getById(Object id)
id
- The id of the entity to retrieve.@JsMethod public EntityCollection getCollection(int index)
index
- the index to retrieve.@JsMethod public int getCollectionsLength()
@JsMethod public int indexOfCollection(EntityCollection collection)
collection
- The collection to find the index of.@JsMethod public void lowerCollection(EntityCollection collection)
collection
- the collection to move.@JsMethod public void lowerCollectionToBottom(EntityCollection collection)
collection
- the collection to move.@JsMethod public void raiseCollection(EntityCollection collection)
collection
- the collection to move.@JsMethod public void raiseCollectionToTop(EntityCollection collection)
collection
- the collection to move.@JsMethod public void removeAllCollections()
@JsMethod public boolean removeCollection(EntityCollection collection)
collection
- The collection to remove.@JsMethod public void resumeEvents()
EntityCollection.collectionChanged()
events immediately when an item is added or removed.
Any modifications made while while events were suspended will be triggered as a single event when this function is called.
This function also ensures the collection is recomposited if events are also resumed. This function is reference
counted and can safely be called multiple times as long as there are corresponding calls to EntityCollection.resumeEvents()
.@JsMethod public void suspendEvents()
EntityCollection.collectionChanged()
events from being raised until a corresponding call is made
to EntityCollection.resumeEvents()
, at which point a single event will be raised that covers all
suspended operations. This allows for many items to be added and removed efficiently. While events are suspended,
recompositing of the collections will also be suspended, as this can be a costly operation. This function can be
safely called multiple times as long as there are corresponding calls to EntityCollection.resumeEvents()
.Copyright © 2019. All rights reserved.