@JsType(isNative=true, namespace="Cesium", name="EntityCollection") public class EntityCollection extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
EntityCollection.CollectionChangedEventCallback
The signature of the event generated by EntityCollection#collectionChanged.
|
Modifier and Type | Field and Description |
---|---|
boolean |
show
Gets whether or not this entity collection should be displayed.
|
Constructor and Description |
---|
EntityCollection()
An observable collection of
Entity instances where each entity has a unique id. |
EntityCollection(CompositeEntityCollection object)
An observable collection of
Entity instances where each entity has a unique id. |
EntityCollection(DataSource owner)
An observable collection of
Entity instances where each entity has a unique id. |
Modifier and Type | Method and Description |
---|---|
Entity |
add(Entity entity)
Add an entity to the collection.
|
Entity |
add(EntityOptions entityOptions)
Add an entity to collection by entity options
|
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.
|
Entity |
getById(Object id)
Gets an entity with the specified id.
|
Entity |
getOrCreateEntity(Object id)
Gets an entity with the specified id or creates it and adds it to the collection if it does not exist.
|
String |
id()
Gets a globally unique identifier for this collection.
|
Object |
owner()
Gets the owner of this entity collection, ie. the data source or composite entity collection which created it.
|
boolean |
remove(Entity entity)
Removes an entity from the collection.
|
void |
removeAll()
Removes all Entities from the collection.
|
boolean |
removeById(Object id)
Removes an entity with the provided id from the collection.
|
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.
|
@JsProperty public boolean show
@JsConstructor public EntityCollection()
Entity
instances where each entity has a unique id.@JsConstructor public EntityCollection(CompositeEntityCollection object)
Entity
instances where each entity has a unique id.object
- CompositeEntityCollection
Composite entity collection which created this collection.@JsConstructor public EntityCollection(DataSource owner)
Entity
instances where each entity has a unique id.owner
- DataSource
The data source which created this collection.@JsProperty(name="collectionChanged") public Event collectionChanged()
@JsProperty(name="id") public String id()
@JsProperty(name="owner") public Object owner()
DataSource
| CompositeEntityCollection
@JsProperty(name="values") public Entity[] values()
@JsMethod public Entity add(Entity entity)
entity
- The entity to be added.@JsMethod public Entity add(EntityOptions entityOptions)
entityOptions
- Entity options@JsMethod public TimeInterval computeAvailability()
@JsMethod public boolean contains(Entity entity)
entity
- true if the provided entity is in this collection, false otherwise.@JsMethod public Entity getById(Object id)
id
- The id of the entity to retrieve.@JsMethod public Entity getOrCreateEntity(Object id)
id
- The id of the entity to retrieve or create.public boolean remove(Entity entity)
entity
- The entity to be removed.@JsMethod public void removeAll()
@JsMethod public boolean removeById(Object id)
id
- The id of the entity to remove.@JsMethod public void resumeEvents()
@JsMethod public void suspendEvents()
Copyright © 2019. All rights reserved.