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 TypeMethodDescriptionbooleancanSetFeature(int aFeatureIndex) Checks whether the specified feature is editable.voidClears the cache.longThis method acts as a shortcut method call to retrieve the begin time of the time bounds fromgetTimeBounds().Returns theILcdBoundsby which the geometry of thisILcdBoundedobject is bounded.getCachedObject(Object aKey) Looks up and returns the cached Object corresponding to the given key.Returns the type of this data object.longThis method acts as a shortcut method call to retrieve the end time of the time bounds fromgetTimeBounds().getFeature(int aFeatureIndex) Returns the featureObjectat the given index.intReturns the number of features.Returns the flight plan history associated with this trajectory.intgetIndexForTimeStamp(long aTimeStamp) Finds the index that corresponds to the given timestamp.getPoint(int aIndex) Returns theILcdPointat a given index.intReturns the number ofILcdPointobjects in the list.voidgetPointSFCT(int aIndex, ILcd3DEditablePoint aPointSFCT) Stores the coordinates of the point ataIndexin the given point.longgetTime(int aIndex) Returns the time corresponding to the pointgetPoint(aIndex).Returns theILcdTimeBoundsby which this object is bounded.getTrackFeature(int aIndex, int aFeatureIndex) Retrieves the track feature indicated by aFeatureIndex at the point indicated by aIndex.intReturns 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.doublegetX(int aIndex) Returns the X coordinate of the point ataIndex.doublegetY(int aIndex) Returns the Y coordinate of the point ataIndex.doublegetZ(int aIndex) Returns the Z coordinate of the point ataIndex.booleanhasValue(TLcdDataProperty aProperty) Indicates whether this data object has a value for the given property.booleanIndicates whether this data object has a value for the given property.voidinsertIntoCache(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.voidsetFeature(int aFeatureIndex, Object aValue) Sets the featureObjectat the given index.voidsetValue(TLcdDataProperty aProperty, Object aValue) Sets the value of the given property for this data object.voidConvenience 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 benullif 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:ILcdTimeBoundedReturns theILcdTimeBoundsby which this object is bounded.- Specified by:
getTimeBoundsin interfaceILcdTimeBounded- Returns:
- the
ILcdTimeBoundsby 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:ILcdPointListReturns the number ofILcdPointobjects in the list.- Specified by:
getPointCountin interfaceILcdPointList- Returns:
- the number of
ILcdPointobjects in the list.
-
getPoint
Description copied from interface:ILcdPointListReturns theILcdPointat a given index.- Specified by:
getPointin interfaceILcdPointList- Parameters:
aIndex- a valid index in the list ofILcdPointobjects.- Returns:
- the
ILcdPointat the given index. - Throws:
IndexOutOfBoundsException- if the given index is out of bounds.
-
getPointSFCT
Description copied from interface:ILcdPointListStores the coordinates of the point ataIndexin the given point.- Specified by:
getPointSFCTin 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:ILcdPointListReturns the X coordinate of the point ataIndex.- Specified by:
getXin 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:ILcdPointListReturns the Y coordinate of the point ataIndex.- Specified by:
getYin 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:ILcdPointListReturns the Z coordinate of the point ataIndex.- Specified by:
getZin 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:
getFeatureCountin interfaceILcdFeatured- Returns:
- the number of features.
-
getFeature
Returns the featureObjectat the given index.Only one feature is available : the id that links together all tracks (and associated messages) in a
TLcdASDITrajectory.- Specified by:
getFeaturein interfaceILcdFeatured- Parameters:
aFeatureIndex- a valid feature index.- Returns:
- the feature
Objectat the given index. - Throws:
IndexOutOfBoundsException- when an index is chosen greater than the result of getFeatureCount.- See Also:
-
setFeature
Sets the featureObjectat 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:
setFeaturein 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:
canSetFeaturein 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 theTLcdASDITrajectoryis 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. SeeILcdASDITrackTZFeaturesandILcdASDITrackTOFeaturesfor more info on TZ and TO track features.- Returns:
- 0 or more
-
getDataType
Description copied from interface:ILcdDataObjectReturns the type of this data object. This can never benull.- Specified by:
getDataTypein interfaceILcdDataObject- Returns:
- the type of this data object
-
getValue
Description copied from interface:ILcdDataObjectReturns 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 typeor in one of its super types. Otherwise anIllegalArgumentExceptionis thrown.- Specified by:
getValuein 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:ILcdDataObjectSets 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 typeor 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:
setValuein interfaceILcdDataObject- Parameters:
aProperty- the property for which the value is to be setaValue- the value to set- See Also:
-
getValue
Description copied from interface:ILcdDataObjectConvenience 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:
getValuein 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:ILcdDataObjectConvenience 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:
setValuein 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:ILcdDataObjectIndicates whether this data object has a value for the given property.aPropertyis from theright data type, and this instance has a value for it: returnstrueaPropertyis from theright data type, and this instance has no value for it: returnsfalseaPropertyis not from theright data type: not allowed, you will get IllegalArgumentExceptionaPropertyisnull: not allowed, you will get NullPointerException
- Specified by:
hasValuein interfaceILcdDataObject- Parameters:
aProperty- the property for which to return whether a value is present or not.- Returns:
trueif this data object has a value for the given property,falseotherwise.
-
hasValue
Description copied from interface:ILcdDataObjectIndicates whether this data object has a value for the given property.
SeeILcdDataObject.hasValue(TLcdDataProperty)for more information.- Specified by:
hasValuein interfaceILcdDataObject- Parameters:
aPropertyName- the name of the property for which to return whether a value is present or not.- Returns:
trueif this data object has a value for the property with the given name,falseotherwise.
-
getTrackFeature
Retrieves the track feature indicated by aFeatureIndex at the point indicated by aIndex. The track features reveal the info in the track messages theTLcdASDITrajectoryis 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. SeeILcdASDITrackTZFeaturesandILcdASDITrackTOFeaturesfor 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
nullwhen 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 inTLcdASDITrackTODataTypesandTLcdASDITrackTZDataTypes, 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;
nullwhen the index is invalid. - Throws:
IllegalArgumentException- when the given property does not match the correct track type.
-
getBounds
Description copied from interface:ILcdBoundedReturns theILcdBoundsby which the geometry of thisILcdBoundedobject 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
undefinedbounds. You can create undefined bounds using the default constructors ofTLcdLonLatBoundsorTLcdXYBounds.- Specified by:
getBoundsin interfaceILcdBounded- Returns:
- the
ILcdBoundsby which the geometry of thisILcdBoundedobject is bounded.
-
insertIntoCache
Description copied from interface:ILcdCacheInserts a cache Object corresponding to the given key Object.- Specified by:
insertIntoCachein 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:ILcdCacheLooks up and returns the cached Object corresponding to the given key.- Specified by:
getCachedObjectin 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:ILcdCacheLooks up and removes the cached Object corresponding to the given key.- Specified by:
removeCachedObjectin 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:ILcdCacheClears the cache.- Specified by:
clearCachein interfaceILcdCache
-