- All Implemented Interfaces:
GeoElement
GeoElement
that represents a real-world object received from a
DynamicEntityDataSource
.
Dynamic entities are updated with data coming from a stream. These updates are referred to as observations and are
represented by the DynamicEntityObservation
class. An observation is a static snapshot of the state of a dynamic
entity at a given time. This snapshot includes the associated dynamic entity's location (geometry) as well as all
its attributes. For example, an observation for a moving aircraft may include updates to attributes like speed,
altitude, and heading in addition to its updated location. While observations remain static, a dynamic entity
changes because it's essentially a pointer to the most recent observation.
The properties of a DynamicEntity, such as its attributes and geometry, are updated when new observations are
received from the server. You should not cache the getGeometry()
or
getAttributes()
collection properties as they are completely replaced when a new observation is
received for the associated DynamicEntity.
- Since:
- 200.1.0
- See Also:
-
Property Summary
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Called whenDynamicEntity
changes.static interface
Defines the callback listener to listen to DynamicEntityChangedListener events. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Registers the given DynamicEntityChangedListener to be called when an update is received from the DynamicEntity.A unique identifier for the DynamicEntity.Gets the attributes.long
Gets the value of theentityId
property.Gets the geometry which defines the shape and location of the GeoElement.getObservations
(int maximumObservations) Gets the collection ofDynamicEntityObservation
objects associated with this dynamic entity.Gets the latestDynamicEntityObservation
associated with this dynamic entity.boolean
Unregisters the given DynamicEntityChangedListener that was previously added usingaddDynamicEntityChangedListener(DynamicEntityChangedListener)
.void
setGeometry
(Geometry geometry) Sets the geometry defines the shape and location of the GeoElement.
-
Property Details
-
entityId
A unique identifier for the DynamicEntity.The entityId property uniquely identifies a DynamicEntity.
- Since:
- 200.1.0
- See Also:
-
-
Method Details
-
entityIdProperty
A unique identifier for the DynamicEntity.The entityId property uniquely identifies a DynamicEntity.
- Returns:
- the
entityId
property - Since:
- 200.1.0
- See Also:
-
getEntityId
public long getEntityId()Gets the value of theentityId
property.- Property description:
- A unique identifier for the DynamicEntity.
The entityId property uniquely identifies a DynamicEntity.
- Returns:
- the value of the
entityId
property - Since:
- 200.1.0
- See Also:
-
latestObservation
Gets the latestDynamicEntityObservation
associated with this dynamic entity.The observation returned by this method represents a snapshot of the state of this dynamic entity at the time the observation was received. This method may return null if the dynamic entity has been purged from the local data cache.
- Returns:
- the latest observation associated with this dynamic entity, or null if none
- Since:
- 200.1.0
- See Also:
-
getObservations
Gets the collection ofDynamicEntityObservation
objects associated with this dynamic entity.Use this method to get a collection of
DynamicEntityObservation
objects associated with this dynamic entity. Observations are associated with a dynamic entity through a shared track ID. ForArcGISStreamService
data sources, the track ID field is defined by theArcGISStreamServiceInfo.trackIdFieldProperty()
property.The returned observations are sorted from the most recent to the oldest.
This method may return an empty collection if the dynamic entity has been purged from the local data cache.
- Parameters:
maximumObservations
- the maximum number of observations to return, including the latest- Returns:
- an unmodifiable list of observations of a DynamicEntity
- Since:
- 200.1.0
- See Also:
-
addDynamicEntityChangedListener
Registers the given DynamicEntityChangedListener to be called when an update is received from the DynamicEntity.Adding this listener on the UI thread will cause it to be invoked on the UI thread, otherwise it is not guaranteed on which thread the listener is invoked.
- Parameters:
listener
- the listener to register- Throws:
NullPointerException
- if the DynamicEntityChangedListener is null- Since:
- 200.1.0
- See Also:
-
removeDynamicEntityChangedListener
public boolean removeDynamicEntityChangedListener(DynamicEntity.DynamicEntityChangedListener listener) Unregisters the given DynamicEntityChangedListener that was previously added usingaddDynamicEntityChangedListener(DynamicEntityChangedListener)
.- Parameters:
listener
- the listener to unregister- Returns:
- true if the listener was successfully removed; false otherwise
- Since:
- 200.1.0
-
getAttributes
Gets the attributes. After aDynamicEntity.DynamicEntityChangedEvent
happens you must call this property to get a new map of attributes to see the updated values.- Specified by:
getAttributes
in interfaceGeoElement
- Returns:
- the attributes
- Since:
- 200.1.0
-
getGeometry
Description copied from interface:GeoElement
Gets the geometry which defines the shape and location of the GeoElement.- Specified by:
getGeometry
in interfaceGeoElement
- Returns:
- the geometry defines the shape and location of the GeoElement, or null if none
-
setGeometry
Description copied from interface:GeoElement
Sets the geometry defines the shape and location of the GeoElement.- Specified by:
setGeometry
in interfaceGeoElement
- Parameters:
geometry
- the geometry defines the shape and location of the GeoElement
-