Class TLcdASDITrajectory
- All Implemented Interfaces:
ILcdDataObject
,ILcdBounded
,ILcdPointList
,ILcdPointList2
,ILcdTimeBounded
,ILcdCache
,ILcdFeatured
,Serializable
getPointCount()
.
The locations can be retrieved using getPoint(int)
and the additional information is accessible through the methods getTrackFeatureCount()
and getTrackFeature(int, int)
.
The flight plan information associated with a
TLcdASDITrajectory
can be retrieved using the getFlightPlanHistory()
method.
TLcdASDITrajectory
objects are based on either TZ or TO messages, each message
contains information on one track. Track messages of the same type that belong to the same flight
are grouped in one TLcdASDITrajectory
. Track properties are accessible using
the getTrackValue(int, com.luciad.datamodel.TLcdDataProperty)
method. This method
is based on the ILcdDataObject
interface. The matching TLcdDataType
of the track can be retrieved using the TLcdASDITrajectoryModelDescriptor.getTrackDataType()
method.
Track data type can be either TLcdASDITrackTODataTypes.TrackTOType
or
TLcdASDITrackTZDataTypes.TrackTZType
).
The track properties (i.e. features) are also accessible through the ILcdFeatured
interface using the
getTrackFeatureCount()
and getTrackFeature(int, int)
methods. Each feature corresponds with a field in the track message.
An overview of all available TZ features can be found in ILcdASDITrackTZFeatures
and of all available TO features in ILcdASDITrackTOFeatures
. These methods exist for backwards
compatibility. It is recommended to use the new ILcdDataObject
interface instead.
Models with TLcdASDITrajectory
objects have model descriptors that are
TLcdASDITrajectoryModelDescriptor
. They describe the features
(available through the ILcdFeatured
interface)
of the TLcdASDITrajectory
objects. Moreover, they have a method
getTrackFeaturedDescriptor()
to retrieve the ILcdFeaturedDescriptor
for the track features.
Note that the flight id that is available in all messages is used as id for the trajectory objects,
but this is not unique, so different trajectories can
have the same id at the same time.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canSetFeature
(int aFeatureIndex) Checks whether the specified feature is editable.void
Clears the cache.long
This method acts as a shortcut method call to retrieve the begin time of the time bounds fromgetTimeBounds()
.Returns theILcdBounds
by which the geometry of thisILcdBounded
object is bounded.getCachedObject
(Object aKey) Looks up and returns the cached Object corresponding to the given key.Returns the type of this data object.long
This method acts as a shortcut method call to retrieve the end time of the time bounds fromgetTimeBounds()
.getFeature
(int aFeatureIndex) Returns the featureObject
at the given index.int
Returns the number of features.Returns the flight plan history associated with this trajectory.int
getIndexForTimeStamp
(long aTimeStamp) Finds the index that corresponds to the given timestamp.getPoint
(int aIndex) Returns theILcdPoint
at a given index.int
Returns the number ofILcdPoint
objects in the list.void
getPointSFCT
(int aIndex, ILcd3DEditablePoint aPointSFCT) Stores the coordinates of the point ataIndex
in the given point.long
getTime
(int aIndex) Returns the time corresponding to the pointgetPoint(aIndex)
.Returns theILcdTimeBounds
by which this object is bounded.getTrackFeature
(int aIndex, int aFeatureIndex) Retrieves the track feature indicated by aFeatureIndex at the point indicated by aIndex.int
Returns the number of features a track contains.getTrackValue
(int aIndex, TLcdDataProperty aProperty) Gets the value of a track property related to this trajectory.getValue
(TLcdDataProperty aProperty) Returns the value of the given property.Convenience method that returns the value of the property with the given name.double
getX
(int aIndex) Returns the X coordinate of the point ataIndex
.double
getY
(int aIndex) Returns the Y coordinate of the point ataIndex
.double
getZ
(int aIndex) Returns the Z coordinate of the point ataIndex
.boolean
hasValue
(TLcdDataProperty aProperty) Indicates whether this data object has a value for the given property.boolean
Indicates whether this data object has a value for the given property.void
insertIntoCache
(Object aKey, Object aObject) Inserts a cache Object corresponding to the given key Object.removeCachedObject
(Object aKey) Looks up and removes the cached Object corresponding to the given key.void
setFeature
(int aFeatureIndex, Object aValue) Sets the featureObject
at the given index.void
setValue
(TLcdDataProperty aProperty, Object aValue) Sets the value of the given property for this data object.void
Convenience method that sets the value of the property with the given name.
-
Method Details
-
getFlightPlanHistory
Returns the flight plan history associated with this trajectory. Note that it can benull
if no flight plan history information is available.- Returns:
- Returns the flight plan history associated with this trajectory, or
null
.
-
getTime
public long getTime(int aIndex) Returns the time corresponding to the pointgetPoint(aIndex)
. It is specified as a value in milliseconds since 1970, similar toDate.getTime()
.- Parameters:
aIndex
- The index of the point for which you want to know the time. This index corresponds to the index ingetPoint(int)
- Returns:
- The time when the aircraft was at getPoint(aIndex).
-
getIndexForTimeStamp
public int getIndexForTimeStamp(long aTimeStamp) Finds the index that corresponds to the given timestamp. More strictly speaking, it returns the index for which this condition holds:getTime( returned_index )
<= aTimeStamp <getTime( returned_index + 1 )
. Note that if 'returned_index' equalsgetPointCount()
-1 (largest possible index),getTime( returned_index )
== aTimeStamp. If the given time stamp is not in the interval [getBeginTime()
,getEndTime()
], -1 is returned.- Parameters:
aTimeStamp
- The timestamp for which the index is requested.- Returns:
- The index in the trajectory that corresponds with aTimeStamp. -1 is returned when the time stamp could not be located.
- See Also:
-
getTimeBounds
Description copied from interface:ILcdTimeBounded
Returns theILcdTimeBounds
by which this object is bounded.- Specified by:
getTimeBounds
in interfaceILcdTimeBounded
- Returns:
- the
ILcdTimeBounds
by which this object is bounded.
-
getBeginTime
public long getBeginTime()This method acts as a shortcut method call to retrieve the begin time of the time bounds fromgetTimeBounds()
.- Returns:
- the begin time of the trajectory.
- See Also:
-
getEndTime
public long getEndTime()This method acts as a shortcut method call to retrieve the end time of the time bounds fromgetTimeBounds()
.- Returns:
- the end time of the trajectory.
- See Also:
-
getPointCount
public int getPointCount()Description copied from interface:ILcdPointList
Returns the number ofILcdPoint
objects in the list.- Specified by:
getPointCount
in interfaceILcdPointList
- Returns:
- the number of
ILcdPoint
objects in the list.
-
getPoint
Description copied from interface:ILcdPointList
Returns theILcdPoint
at a given index.- Specified by:
getPoint
in interfaceILcdPointList
- Parameters:
aIndex
- a valid index in the list ofILcdPoint
objects.- Returns:
- the
ILcdPoint
at the given index. - Throws:
IndexOutOfBoundsException
- if the given index is out of bounds.
-
getPointSFCT
Description copied from interface:ILcdPointList
Stores the coordinates of the point ataIndex
in the given point.- Specified by:
getPointSFCT
in interfaceILcdPointList
- Parameters:
aIndex
- the index of the point for which to retrieve the coordinates.aPointSFCT
- the side-effect parameter in which to store the coordinates of the requested point.
-
getX
public double getX(int aIndex) Description copied from interface:ILcdPointList
Returns the X coordinate of the point ataIndex
.- Specified by:
getX
in interfaceILcdPointList
- Parameters:
aIndex
- the index of the point for which to return the X coordinate.- Returns:
- the X coordinate of the point at
aIndex
.
-
getY
public double getY(int aIndex) Description copied from interface:ILcdPointList
Returns the Y coordinate of the point ataIndex
.- Specified by:
getY
in interfaceILcdPointList
- Parameters:
aIndex
- the index of the point for which to return the Y coordinate.- Returns:
- the Y coordinate of the point at
aIndex
.
-
getZ
public double getZ(int aIndex) Description copied from interface:ILcdPointList
Returns the Z coordinate of the point ataIndex
.- Specified by:
getZ
in interfaceILcdPointList
- Parameters:
aIndex
- the index of the point for which to return the Z coordinate.- Returns:
- the Z coordinate of the point at
aIndex
.
-
getFeatureCount
public int getFeatureCount()Returns the number of features.See
getFeature(int)
for more info on trajectory features.- Specified by:
getFeatureCount
in interfaceILcdFeatured
- Returns:
- the number of features.
-
getFeature
Returns the featureObject
at the given index.Only one feature is available : the id that links together all tracks (and associated messages) in a
TLcdASDITrajectory
.- Specified by:
getFeature
in interfaceILcdFeatured
- Parameters:
aFeatureIndex
- a valid feature index.- Returns:
- the feature
Object
at the given index. - Throws:
IndexOutOfBoundsException
- when an index is chosen greater than the result of getFeatureCount.- See Also:
-
setFeature
Sets the featureObject
at the given index.See
getFeature(int)
for more info on trajectory features.None of the features are editable, so calling this method always results in throwing an
IllegalArgumentException
.- Specified by:
setFeature
in interfaceILcdFeatured
- Parameters:
aFeatureIndex
- a valid feature index.aValue
- the new featureObject
.- Throws:
IllegalArgumentException
- if the feature can't be set.- See Also:
-
canSetFeature
public boolean canSetFeature(int aFeatureIndex) Checks whether the specified feature is editable.See
getFeature(int)
for more info on trajectory features.None of the features are editable, so always returns
.false
- Specified by:
canSetFeature
in interfaceILcdFeatured
- Parameters:
aFeatureIndex
- a valid feature index.- Returns:
- true if the feature can be set, false otherwise.
-
getTrackFeatureCount
public int getTrackFeatureCount()Returns the number of features a track contains. The track features reveal the info in the track messages theTLcdASDITrajectory
is based on. Since all tracks of a trajectory are based on messages of the same type (either TZ or TO) the number of track features is independent from the track index and only depends on the message type : it corresponds with the number of fields for the message type. SeeILcdASDITrackTZFeatures
andILcdASDITrackTOFeatures
for more info on TZ and TO track features.- Returns:
- 0 or more
-
getDataType
Description copied from interface:ILcdDataObject
Returns the type of this data object. This can never benull
.- Specified by:
getDataType
in interfaceILcdDataObject
- Returns:
- the type of this data object
-
getValue
Description copied from interface:ILcdDataObject
Returns the value of the given property.
If the property is a collection, the returned value will never be null. If the property has not been set, an empty collection of the appropriate type will be returned (Set, List or Map).
The property must not be null, and must be declared in the
data object's type
or in one of its super types. Otherwise anIllegalArgumentException
is thrown.- Specified by:
getValue
in interfaceILcdDataObject
- Parameters:
aProperty
- the property for which the value is to be returned- Returns:
- the value of the given property for this data object
-
setValue
Description copied from interface:ILcdDataObject
Sets the value of the given property for this data object. The implementation is allowed to throw an exception if the given value can't be set.
The given property must be declared in thedata object's type
or in one of its super types. In other words, getDataType().getProperties().contains( aProperty ) should always be true. Otherwise, the implementation should throw anIllegalArgumentException
.- Specified by:
setValue
in interfaceILcdDataObject
- Parameters:
aProperty
- the property for which the value is to be setaValue
- the value to set- See Also:
-
getValue
Description copied from interface:ILcdDataObject
Convenience method that returns the value of the property with the given name.
If more than one property exists with the given name, the most specific property should be used (this is the property defined by the most specialized type in this object's data type hierarchy). SeeILcdDataObject.getValue(TLcdDataProperty)
for more information.- Specified by:
getValue
in interfaceILcdDataObject
- Parameters:
aPropertyName
- the name of the property of which the value is to be returned- Returns:
- the value of the property with the given name
- See Also:
-
setValue
Description copied from interface:ILcdDataObject
Convenience method that sets the value of the property with the given name.
If more than one property exists with the given name, the most specific property should be used (this is the property defined by the most specialized type in this object's data type hierarchy). SeeILcdDataObject.setValue(TLcdDataProperty, Object)
for more information.- Specified by:
setValue
in interfaceILcdDataObject
- Parameters:
aPropertyName
- the name of the property of which the value is to be setaValue
- the value to set
-
hasValue
Description copied from interface:ILcdDataObject
Indicates whether this data object has a value for the given property.aProperty
is from theright data type
, and this instance has a value for it: returnstrue
aProperty
is from theright data type
, and this instance has no value for it: returnsfalse
aProperty
is not from theright data type
: not allowed, you will get IllegalArgumentExceptionaProperty
isnull
: not allowed, you will get NullPointerException
- Specified by:
hasValue
in interfaceILcdDataObject
- Parameters:
aProperty
- the property for which to return whether a value is present or not.- Returns:
true
if this data object has a value for the given property,false
otherwise.
-
hasValue
Description copied from interface:ILcdDataObject
Indicates whether this data object has a value for the given property.
SeeILcdDataObject.hasValue(TLcdDataProperty)
for more information.- Specified by:
hasValue
in interfaceILcdDataObject
- Parameters:
aPropertyName
- the name of the property for which to return whether a value is present or not.- Returns:
true
if this data object has a value for the property with the given name,false
otherwise.
-
getTrackFeature
Retrieves the track feature indicated by aFeatureIndex at the point indicated by aIndex. The track features reveal the info in the track messages theTLcdASDITrajectory
is based on. Since all tracks of a trajectory are based on messages of the same type (either TZ or TO), but each message type has its own structure, trajectories based on TZ and TO messages have different track features. The features correspond with the fields in either message. SeeILcdASDITrackTZFeatures
andILcdASDITrackTOFeatures
for more info on TZ and TO track features.- Parameters:
aIndex
- The index for the point for which you want to know the feature value. This index corresponds to the index ingetPoint(int)
.aFeatureIndex
- Determines what particular feature value you want to retrieve. Must be smaller thangetTrackFeatureCount()
.- Returns:
- The requested feature at the specified point or
null
when the index is invalid. - Throws:
IndexOutOfBoundsException
- When aFeatureIndex is greater than or equal to getTrackFeatureCount
-
getTrackValue
Gets the value of a track property related to this trajectory. The properties of a track can be found inTLcdASDITrackTODataTypes
andTLcdASDITrackTZDataTypes
, depending on whether the tracks represented by this trajectory are constructed using TO messages, or TZ messages. To find out which track matches this trajectory, you can useTLcdASDITrajectoryModelDescriptor.getTrackDataType()
.- Parameters:
aIndex
- The index for the point for which you want to know the property value. This index corresponds to the index ingetPoint(int)
.aProperty
- The property of which you want the value of. Property must be of the correct type depending on the type of tracks represented by this trajectory.- Returns:
- The value of the property at the specified point;
null
when the index is invalid. - Throws:
IllegalArgumentException
- when the given property does not match the correct track type.
-
getBounds
Description copied from interface:ILcdBounded
Returns theILcdBounds
by which the geometry of thisILcdBounded
object is bounded.If the geometry does not allow retrieving valid bounds (for example a polyline with 0 points) the return value is unspecified. It is highly recommended to return an
undefined
bounds. You can create undefined bounds using the default constructors ofTLcdLonLatBounds
orTLcdXYBounds
.- Specified by:
getBounds
in interfaceILcdBounded
- Returns:
- the
ILcdBounds
by which the geometry of thisILcdBounded
object is bounded.
-
insertIntoCache
Description copied from interface:ILcdCache
Inserts a cache Object corresponding to the given key Object.- Specified by:
insertIntoCache
in interfaceILcdCache
- Parameters:
aKey
- the key Object that will be used to identify the Object. The key must therefore be a unique identifier, typically the caller itself:insertIntoCache(this, ...)
.aObject
- the Object to be cached.
-
getCachedObject
Description copied from interface:ILcdCache
Looks up and returns the cached Object corresponding to the given key.- Specified by:
getCachedObject
in interfaceILcdCache
- Parameters:
aKey
- the key Object that was used for storing the cache Object.- Returns:
- the cached Object, or null if there is no Object corresponding to the given key.
-
removeCachedObject
Description copied from interface:ILcdCache
Looks up and removes the cached Object corresponding to the given key.- Specified by:
removeCachedObject
in interfaceILcdCache
- Parameters:
aKey
- the key Object that was used for storing the cache Object.- Returns:
- the cached Object, or null if there was no Object corresponding to the given key.
-
clearCache
public void clearCache()Description copied from interface:ILcdCache
Clears the cache.- Specified by:
clearCache
in interfaceILcdCache
-