Class TLcdASDITrajectory

java.lang.Object
com.luciad.format.asdi.TLcdASDITrajectory
All Implemented Interfaces:
ILcdDataObject, ILcdBounded, ILcdPointList, ILcdPointList2, ILcdTimeBounded, ILcdCache, ILcdFeatured, Serializable

public class TLcdASDITrajectory extends Object implements ILcdPointList, ILcdPointList2, ILcdBounded, ILcdFeatured, ILcdCache, ILcdTimeBounded, ILcdDataObject
Models the path of a track flying from one point to another. The path is discretized, and for every time stamp it contains the location and additional information of the track.

The number of steps in the discretization can be retrieved using 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 Details

    • getFlightPlanHistory

      public TLcdASDIFlightPlanHistory getFlightPlanHistory()
      Returns the flight plan history associated with this trajectory. Note that it can be null 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 point getPoint(aIndex). It is specified as a value in milliseconds since 1970, similar to Date.getTime().
      Parameters:
      aIndex - The index of the point for which you want to know the time. This index corresponds to the index in getPoint(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' equals getPointCount() -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

      public ILcdTimeBounds getTimeBounds()
      Description copied from interface: ILcdTimeBounded
      Returns the ILcdTimeBounds by which this object is bounded.
      Specified by:
      getTimeBounds in interface ILcdTimeBounded
      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 from getTimeBounds().
      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 from getTimeBounds().
      Returns:
      the end time of the trajectory.
      See Also:
    • getPointCount

      public int getPointCount()
      Description copied from interface: ILcdPointList
      Returns the number of ILcdPoint objects in the list.
      Specified by:
      getPointCount in interface ILcdPointList
      Returns:
      the number of ILcdPoint objects in the list.
    • getPoint

      public ILcdPoint getPoint(int aIndex) throws IndexOutOfBoundsException
      Description copied from interface: ILcdPointList
      Returns the ILcdPoint at a given index.
      Specified by:
      getPoint in interface ILcdPointList
      Parameters:
      aIndex - a valid index in the list of ILcdPoint objects.
      Returns:
      the ILcdPoint at the given index.
      Throws:
      IndexOutOfBoundsException - if the given index is out of bounds.
    • getPointSFCT

      public void getPointSFCT(int aIndex, ILcd3DEditablePoint aPointSFCT)
      Description copied from interface: ILcdPointList
      Stores the coordinates of the point at aIndex in the given point.
      Specified by:
      getPointSFCT in interface ILcdPointList
      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 at aIndex.
      Specified by:
      getX in interface ILcdPointList
      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 at aIndex.
      Specified by:
      getY in interface ILcdPointList
      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 at aIndex.
      Specified by:
      getZ in interface ILcdPointList
      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 interface ILcdFeatured
      Returns:
      the number of features.
    • getFeature

      public Object getFeature(int aFeatureIndex) throws IndexOutOfBoundsException
      Returns the feature Object 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 interface ILcdFeatured
      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

      public void setFeature(int aFeatureIndex, Object aValue) throws IllegalArgumentException
      Sets the feature Object 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 interface ILcdFeatured
      Parameters:
      aFeatureIndex - a valid feature index.
      aValue - the new feature Object.
      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 interface ILcdFeatured
      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 the TLcdASDITrajectory 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. See ILcdASDITrackTZFeatures and ILcdASDITrackTOFeatures for more info on TZ and TO track features.

      Returns:
      0 or more
    • getDataType

      public TLcdDataType getDataType()
      Description copied from interface: ILcdDataObject
      Returns the type of this data object. This can never be null.
      Specified by:
      getDataType in interface ILcdDataObject
      Returns:
      the type of this data object
    • getValue

      public Object getValue(TLcdDataProperty aProperty)
      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 an IllegalArgumentException is thrown.

      Specified by:
      getValue in interface ILcdDataObject
      Parameters:
      aProperty - the property for which the value is to be returned
      Returns:
      the value of the given property for this data object
    • setValue

      public void setValue(TLcdDataProperty aProperty, Object aValue)
      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 the data 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 an IllegalArgumentException.

      Specified by:
      setValue in interface ILcdDataObject
      Parameters:
      aProperty - the property for which the value is to be set
      aValue - the value to set
      See Also:
    • getValue

      public Object getValue(String aPropertyName)
      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).

      See ILcdDataObject.getValue(TLcdDataProperty) for more information.

      Specified by:
      getValue in interface ILcdDataObject
      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

      public void setValue(String aPropertyName, Object aValue)
      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).

      See ILcdDataObject.setValue(TLcdDataProperty, Object) for more information.

      Specified by:
      setValue in interface ILcdDataObject
      Parameters:
      aPropertyName - the name of the property of which the value is to be set
      aValue - the value to set
    • hasValue

      public boolean hasValue(TLcdDataProperty aProperty)
      Description copied from interface: ILcdDataObject
      Indicates whether this data object has a value for the given property.

      • aProperty is from the right data type, and this instance has a value for it: returns true
      • aProperty is from the right data type, and this instance has no value for it: returns false
      • aProperty is not from the right data type: not allowed, you will get IllegalArgumentException
      • aProperty is null: not allowed, you will get NullPointerException

      A multivalued property is considered to have a value if it has at least one value.

      Specified by:
      hasValue in interface ILcdDataObject
      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

      public boolean hasValue(String aPropertyName)
      Description copied from interface: ILcdDataObject
      Indicates whether this data object has a value for the given property.
      See ILcdDataObject.hasValue(TLcdDataProperty) for more information.
      Specified by:
      hasValue in interface ILcdDataObject
      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

      public Object getTrackFeature(int aIndex, int aFeatureIndex) throws IndexOutOfBoundsException
      Retrieves the track feature indicated by aFeatureIndex at the point indicated by aIndex.

      The track features reveal the info in the track messages the TLcdASDITrajectory 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. See ILcdASDITrackTZFeatures and ILcdASDITrackTOFeatures 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 in getPoint(int).
      aFeatureIndex - Determines what particular feature value you want to retrieve. Must be smaller than getTrackFeatureCount().
      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

      public Object getTrackValue(int aIndex, TLcdDataProperty aProperty)
      Gets the value of a track property related to this trajectory. The properties of a track can be found in TLcdASDITrackTODataTypes and TLcdASDITrackTZDataTypes, 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 use TLcdASDITrajectoryModelDescriptor.getTrackDataType().
      Parameters:
      aIndex - The index for the point for which you want to know the property value. This index corresponds to the index in getPoint(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

      public ILcdBounds getBounds()
      Description copied from interface: ILcdBounded
      Returns the ILcdBounds by which the geometry of this ILcdBounded 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 of TLcdLonLatBounds or TLcdXYBounds.

      Specified by:
      getBounds in interface ILcdBounded
      Returns:
      the ILcdBounds by which the geometry of this ILcdBounded object is bounded.
    • insertIntoCache

      public void insertIntoCache(Object aKey, Object aObject)
      Description copied from interface: ILcdCache
      Inserts a cache Object corresponding to the given key Object.
      Specified by:
      insertIntoCache in interface ILcdCache
      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

      public Object getCachedObject(Object aKey)
      Description copied from interface: ILcdCache
      Looks up and returns the cached Object corresponding to the given key.
      Specified by:
      getCachedObject in interface ILcdCache
      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

      public Object removeCachedObject(Object aKey)
      Description copied from interface: ILcdCache
      Looks up and removes the cached Object corresponding to the given key.
      Specified by:
      removeCachedObject in interface ILcdCache
      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 interface ILcdCache