Class TLcdASTERIXTrack

All Implemented Interfaces:
ILcdDataObject, ILcdBounded, ILcdBounds, ILcdPoint, ILcdPointList, ILcdPolypoint, ILcdShape, ILcd2DEditablePoint, ILcd2DEditableShape, ILcd3DEditablePoint, ILcd3DEditableShape, ILcdCloneable, ILcdFeatured, ILcdOriented, Serializable, Cloneable

public class TLcdASTERIXTrack extends TLcdLonLatHeightPoint implements ILcdFeatured, ILcdOriented, ILcdDataObject
Time-dependent view on a TLcdASTERIXTrajectory. It represents the location, heading and properties of the TLcdASTERIXTrajectory at a given index.

A TLcdASTERIXTrajectory represents the whole path of an aircraft, including a location and additional information (the properties of its TLcdDataType) for every timestamp. This TLcdASTERIXTrack object however represents an aircraft at a certain time/position, so it represents a TLcdASTERIXTrajectory at a given index.

The trajectory can be retrieved using getTrajectory(). The index can be retrieved by using getTrajectoryPointIndex(), or it can be changed using setTrajectoryPointIndex(int).

To update the state of a TLcdASTERIXTrack, one should either:

  • Use updateForIndex(int) to update the state of this track to a given index (both the properties of its TLcdDataType and its location). Note that the method TLcdASTERIXTrajectory.getIndexForTimeStamp(long) can be used to retrieve the index for a given time value.
  • Or manually update the trajectory index by following these steps:
    1. Update the point index, using setTrajectoryPointIndex(int).
    2. Update the location of the track, for example by doing
      
      if (isActive()) {
        move3D(getTrajectory().getPoint(getTrajectoryPointIndex()));
      }
         
      Note that this piece of code updates the location of the track to the location that corresponds to the trajectory index. A more advanced update of the location would for example be to interpolate the track location between the current and the next point.
See Also:
  • Constructor Details

    • TLcdASTERIXTrack

      public TLcdASTERIXTrack(TLcdASTERIXTrajectory aTrajectory)
      Constructs a new TLcdASTERIXTrack that has a reference to a TLcdASTERIXTrajectory.
      Parameters:
      aTrajectory - The TLcdASTERIXTrajectory on which this TLcdASTERIXTrack is based.
  • Method Details

    • getTrajectoryPointIndex

      public int getTrajectoryPointIndex()
      Returns the index for which this track represents the trajectory.
      Returns:
      the index for which this track represents the trajectory.
    • setTrajectoryPointIndex

      public void setTrajectoryPointIndex(int aPointIndex)
      Sets the index for which this track represents the trajectory. The features of this track will represent new values according to the set index.

      Note that the method TLcdASTERIXTrajectory.getIndexForTimeStamp(long) can be used to retrieve the index for a given time value.

      Parameters:
      aPointIndex - The index that corresponds to the point in the trajectory which this track should represent. Set this to -1 to mark the track as inactive.
    • updateForIndex

      public void updateForIndex(int aTrajectoryPointIndex)

      Updates the state of this track so that it reflects the state of the trajectory at the given aTrajectoryPointIndex.

      It updates the properties similarly to setTrajectoryPointIndex(int), but it also updates the location of this track, according to the given point index.

      Note that the method TLcdASTERIXTrajectory.getIndexForTimeStamp(long) can be used to retrieve the index for a given time value.

      Parameters:
      aTrajectoryPointIndex - The point index of the trajectory, 0 <= aTrajectoryPointIndex <= getTrajectory().getPointCount()
    • getFeatureCount

      public int getFeatureCount()
      Description copied from interface: ILcdFeatured
      Returns the number of features.
      Specified by:
      getFeatureCount in interface ILcdFeatured
      Returns:
      the number of features.
    • getFeature

      public Object getFeature(int i) throws IndexOutOfBoundsException
      Returns the feature object on index i from the current trajectory point. So it is equivalent to getTrajectory().getTrackFeature( getTrajectoryPointIndex(), i ).
      Specified by:
      getFeature in interface ILcdFeatured
      Parameters:
      i - The index of the feature, must be smaller than getFeatureCount().
      Returns:
      The feature object on index i from the current trajectory point.
      Throws:
      IndexOutOfBoundsException
      See Also:
    • canSetFeature

      public boolean canSetFeature(int aIndex)
      Description copied from interface: ILcdFeatured
      Checks whether the specified feature is editable.
      Specified by:
      canSetFeature in interface ILcdFeatured
      Parameters:
      aIndex - a valid feature index.
      Returns:
      true if the feature can be set, false otherwise.
    • setFeature

      public void setFeature(int aIndex, Object aObject) throws IllegalArgumentException
      Description copied from interface: ILcdFeatured
      Sets the feature Object at the given index.
      Specified by:
      setFeature in interface ILcdFeatured
      Parameters:
      aIndex - a valid feature index.
      aObject - the new feature Object.
      Throws:
      IllegalArgumentException - if the feature can't be set.
      See Also:
    • getTrajectory

      public TLcdASTERIXTrajectory getTrajectory()
      Every TLcdASTERIXTrack has a reference to exactly one TLcdASTERIXTrajectory.
      Returns:
      The TLcdASTERIXTrajectory that is referenced by this TLcdASTERIXTrack.
    • isActive

      public boolean isActive()
      Returns whether or not this track is still active. A track is considered active when getTrajectoryPointIndex() != -1.
      Returns:
      true if this track represents the trajectory at a certain valid point, false if not.
    • getOrientation

      public double getOrientation()
      Returns the heading of the track that corresponds to getTrajectoryPointIndex().
      Specified by:
      getOrientation in interface ILcdOriented
      Returns:
      the heading of the track that corresponds to getTrajectoryPointIndex(). If the track is not active, will return Double.NaN
    • equals

      public boolean equals(Object aObject)
      Description copied from class: TLcdLonLatHeightPoint
      Checks whether the object has the same class as this object and whether the coordinates are equal or differ by 360 for longitudes.
      Specified by:
      equals in interface ILcdPoint
      Overrides:
      equals in class TLcdLonLatHeightPoint
      Parameters:
      aObject - the object to check for equality
      Returns:
      true if the object has the same class and it has the same coordinates, taking into account a 360 degree difference for longitudes.
    • hashCode

      public int hashCode()
      Description copied from class: ALcdShape
      The hash code of this shape is the hash code of its class, in order to be consistent with the ALcdShape.equals(Object) method. Extensions should refine this implementation, based on their properties.
      Overrides:
      hashCode in class ALcdPoint
    • toString

      public String toString()
      Overrides:
      toString in class ALcd3DEditablePoint
    • 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
    • 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
    • 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.