Class TLcdASDIFlightPlanHistory
- All Implemented Interfaces:
ILcdDataObject,ILcdBounded,ILcdPointList,ILcdTimeBounded,ILcdCache,ILcdFeatured,Serializable
TLcdASDIFlightPlanHistory objects are based on a mix of FZ, AF, DZ, UZ, AZ, RZ and RT messages.
Flight plan messages that belong together are added to the same TLcdASDIFlightPlanHistory .
The number of flight plans in the history
can be retrieved using getFlightPlanCount().
The intended path at each timestamp can be retrieved using the getPointCount(int)
and getPoint(int, int) methods, the additional information (the flight plan features)
is accessible through the getFlightPlanFeatureCount() and
getFlightPlanFeature(int, int) methods. An overview of all available flight plan
features can be found in ILcdASDIFlightPlanFeatures.
TLcdASDIFlightPlanHistory objects are ILcdPointList,
the methods getPointCount() and getPoint(int) allow to retrieve the points
of the most recent intended path.
It is also possible to access the flight plan messages through
getMessageValue(int, com.luciad.datamodel.TLcdDataProperty). The TLcdDataType of a message
can be retrieved using the getMessageDataType(int) method . An overview of all flight plan message data types and
properties can be found in TLcdASDIMessageDataTypes.
It is also possible to access the flight plan messages using the ILcdFeatured interface through
the methods getMessageCount() , getMessageFeatureCount(int)
and getMessageFeature(int, int). The type of a message can be retrieved using
getMessageType(int) . An overview of all flight plan message features
can be found in ILcdASDIFlightPlanMessageFeatures. These methods exist for backwards
compatibility. It is recommended to use the new ILcdDataObject interface instead.
Models with TLcdASDIFlightPlanHistory objects have model descriptors that are
TLcdASDIFlightPlanHistoryModelDescriptor. They describe the features
(available through the ILcdFeatured interface)
of the TLcdASDIFlightPlanHistory objects. Moreover, they have a method
getFlightPlanFeaturedDescriptor()
to retrieve the ILcdFeaturedDescriptor for the flight plan features and a method
getMessageFeaturedDescriptor(String aMessageType)
to retrieve the ILcdFeaturedDescriptor for the flight plan message features.
The message type that must be provided as argument can be obtained from
getMessageType(int aMessageIndex).
Note that the flight id that is available in all messages is used as id for the flight plan history objects,
but this is not unique, so different flight plan history objects 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.longReturns the begin time of thisTLcdASDIFlightPlanHistory.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.longReturns the end time of thisTLcdASDIFlightPlanHistory.getFeature(int aFeatureIndex) Returns the featureObjectat the given index.intReturns the number of features.intReturns the number of flight plans in this flight plan history.getFlightPlanFeature(int aFlightPlanIndex, int aFeatureIndex) Retrieves the flight plan feature indicated byaFeatureIndexfor the flight plan at indexaFlightPlanIndex.intReturns the number of features in a flight plan.getFlightPlanValue(int aFlightPlanIndex, TLcdDataProperty aProperty) Gets the value of a flight plan property related to this flight plan history.intgetIndexForTimeStamp(long aTimeStamp) Finds the index that corresponds to the given timestamp.intReturns the number of messages in this flight plan history.getMessageDataType(int aMessageIndex) Returns theTLcdDataTypeof the message at the given index.getMessageFeature(int aMessageIndex, int aFeatureIndex) Retrieves the message feature indicated byaFeatureIndexfor the message with indexaMessageIndex.intgetMessageFeatureCount(int aMessageIndex) Returns the number of features in the message with indexaMessageIndex.getMessageType(int aMessageIndex) Returns aStringindicating the type of the message with indexaMessageIndex.getMessageValue(int aMessageIndex, TLcdDataProperty aProperty) Retrieves the value of theTLcdDataPropertyfor a given message index.getPoint(int aPointIndex) Retrieves the position indicated byaPointIndexin the most recent intended path.getPoint(int aFlightPlanIndex, int aPointIndex) Retrieves the position indicated byaPointIndexin the intended path of the flight plan at indexaFlightPlanIndex.intReturns the number of points in the most recent intended path.intgetPointCount(int aFlightPlanIndex) Returns the number of points in the intended path of the flight plan at indexaFlightPlanIndex.longgetTime(int aFlightPlanIndex) Returns the time that corresponds with flight planaFlightPlanIndex.Returns theILcdTimeBoundsby which this object is bounded.getValue(TLcdDataProperty aProperty) Returns the value of the given property.Convenience method that returns the value of the property with the given name.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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.shape.ILcdPointList
getPointSFCT, getX, getY, getZ
-
Method Details
-
getTime
public long getTime(int aFlightPlanIndex) Returns the time that corresponds with flight planaFlightPlanIndex. It is specified as a value in milliseconds since 1970, similar toDate.getTime().- Parameters:
aFlightPlanIndex- The index of the flight plan for which you want to know the time.- Returns:
- The time that corresponds with flight plan
aFlightPlanIndex.
-
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' equalsgetFlightPlanCount()-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 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()Returns the begin time of thisTLcdASDIFlightPlanHistory. The begin time corresponds with the first time the associated flight plan is known to be active. The long value is defined as inDate.getTime(). This method acts as a shortcut method call to retrieve the begin time of the time bounds fromgetTimeBounds().- Returns:
- the begin date.
- See Also:
-
getEndTime
public long getEndTime()Returns the end time of thisTLcdASDIFlightPlanHistory. The end time corresponds with the last time the associated flight plan is known to be active. The long value is defined as inDate.getTime()This method acts as a shortcut method call to retrieve the begin time of the time bounds fromgetTimeBounds().- Returns:
- the end date.
- See Also:
-
getMessageCount
public int getMessageCount()Returns the number of messages in this flight plan history. Each time a message is added to this flight plan history a change is triggered and an extra flight plan is available in the history. ThegetMessageCount()andgetFlightPlanCount()therefor always give the same result and can be used interchangeable.- Returns:
- the number of messages in this flight plan history object.
- See Also:
-
getMessageFeatureCount
public int getMessageFeatureCount(int aMessageIndex) Returns the number of features in the message with indexaMessageIndex. SeeILcdASDIFlightPlanMessageFeaturesfor more info on flight plan message features.- Parameters:
aMessageIndex- The index of the message for which you want to know the feature count. Must be smaller thangetMessageCount().- Returns:
- the number of features in the specified message.
- See Also:
-
getMessageFeature
Retrieves the message feature indicated byaFeatureIndexfor the message with indexaMessageIndex. SeeILcdASDIFlightPlanMessageFeaturesfor more info on flight plan message features.- Parameters:
aMessageIndex- The index of the message for which you want to know the feature value. Must be smaller thangetMessageCount().aFeatureIndex- Determines what particular feature value you want to retrieve. Must be smaller thangetMessageFeatureCount(int).- Returns:
- The requested feature for the specified message.
-
getMessageValue
Retrieves the value of theTLcdDataPropertyfor a given message index. The data property must be of the correct data type. To find the data type, use thegetMessageDataType(int)method. The properties for all data types returned by this method are described inTLcdASDIMessageDataTypes.- Parameters:
aMessageIndex- The index of the message for which you want to know the property value. Must be smaller thangetMessageCount().aProperty- aTLcdDataPropertythat was declared in the data type returned bygetMessageDataType(int)- Returns:
- The requested feature for the specified message, or null if the message index was out of bounds.
- Throws:
IllegalArgumentException- when the given data property was not declared in theTLcdDataTypeof the message. To make sure this does not happen, usegetMessageDataType(int)to obtain the data type of the message beforehand.- See Also:
-
getMessageType
Returns aStringindicating the type of the message with indexaMessageIndex. Message types correspond with the abbreviations of the messages used in the specification : FZ, AF, DZ, UZ, AZ, RZ or RT. For instance, the message type of FZ messages is theString"FZ".- Parameters:
aMessageIndex- The index of the message for which you want to know the type. Must be smaller thangetMessageCount().- Returns:
- the
Stringindicating the type of the specified message, null if not known.
-
getMessageDataType
Returns theTLcdDataTypeof the message at the given index. This data type will be supertyped byTLcdASDIMessageDataTypes.AbstractASDIMessageType, and will be one of theTLcdDataTypeinstances found in theTLcdASDIMessageDataTypesclass.- Parameters:
aMessageIndex- The index of the message for which you want to know the type. Must be smaller thangetMessageCount().- Returns:
- the
TLcdDataTypeof the message, of null if not known. - See Also:
-
getFlightPlanCount
public int getFlightPlanCount()Returns the number of flight plans in this flight plan history. Each time a message is added to this flight plan history a change is triggered and an extra flight plan is available in the history. ThegetMessageCount()andgetFlightPlanCount()therefor always give the same result and can be used interchangeable.- Returns:
- the number of flight plans in this flight plan history.
-
getFlightPlanFeatureCount
public int getFlightPlanFeatureCount()Returns the number of features in a flight plan. SeeILcdASDIFlightPlanFeaturesfor more info on flight plan features.- Returns:
- the number of features in a flight plan.
- See Also:
-
getFlightPlanFeature
Retrieves the flight plan feature indicated byaFeatureIndexfor the flight plan at indexaFlightPlanIndex. SeeILcdASDIFlightPlanFeaturesfor more info on flight plan features.- Parameters:
aFlightPlanIndex- The index of the flight plan for which you want to know the feature value. Must be smaller thangetFlightPlanCount().aFeatureIndex- Determines what particular feature value you want to retrieve. Must be smaller thangetFlightPlanFeatureCount().- Returns:
- The requested feature for the flight plan at index
aFlightPlanIndex.
-
getFlightPlanValue
Gets the value of a flight plan property related to this flight plan history. The properties of a track can be found inTLcdASDIFlightPlanDataTypes.- Parameters:
aFlightPlanIndex- The index of the flight plan for which you want to know the property value.aProperty- The property of which you want the value of. Property must be fromTLcdASDIFlightPlanDataTypes- Returns:
- The value of the property at the specified point;
nullwhen the index is invalid. - Throws:
IllegalArgumentException- when the given property is not declared in the flight planTLcdDataType.
-
getFeatureCount
public int getFeatureCount()Returns the number of features.See
getFeature(int)for more info on flight plan history 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 flight plans (and their messages) in a
TLcdASDIFlightPlanHistory.- 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 flight plan history 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 flight plan history 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.
-
getPointCount
public int getPointCount(int aFlightPlanIndex) Returns the number of points in the intended path of the flight plan at indexaFlightPlanIndex.- Parameters:
aFlightPlanIndex- The index of the flight plan for which you want to know the intended path. Must be smaller thangetFlightPlanCount().- Returns:
- the number of points in the intended path of the flight plan at index
aFlightPlanIndex. - See Also:
-
getPoint
Retrieves the position indicated byaPointIndexin the intended path of the flight plan at indexaFlightPlanIndex.- Parameters:
aFlightPlanIndex- The index of the flight plan for which you want to know the intended path position. Must be smaller thangetFlightPlanCount().aPointIndex- Determines what particular point you want to retrieve. Must be smaller thangetPointCount(int).- Returns:
- The requested intended path position for the flight plan at index
aFlightPlanIndex. - Throws:
IndexOutOfBoundsException- when the point index is greater than or equal to getPointCount
-
getPointCount
public int getPointCount()Returns the number of points in the most recent intended path. The most recent intended path defines the geometry of the flight plan history. It corresponds with the intended path of the last flight plan, so with the points defined bygetPointCount(getFlightPlanCount() - 1)andgetPoint(getFlightPlanCount() - 1, aPointIndex).- Specified by:
getPointCountin interfaceILcdPointList- Returns:
- the number of points in the most recent intended path.
- See Also:
-
getPoint
Retrieves the position indicated byaPointIndexin the most recent intended path. The most recent intended path defines the geometry of the flight plan history. It corresponds with the intended path of the last flight plan, so with the points defined bygetPointCount(getFlightPlanCount() - 1)andgetPoint(getFlightPlanCount() - 1, aPointIndex).- Specified by:
getPointin interfaceILcdPointList- Parameters:
aPointIndex- Determines what particular point you want to retrieve. Must be smaller thangetPointCount().- Returns:
- The requested position in the most recent intended path.
- Throws:
IndexOutOfBoundsException- if the given index is out of bounds.
-
getBounds
Returns 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
The bounds include the points of the most recent intended path (accessable throughundefinedbounds. You can create undefined bounds using the default constructors ofTLcdLonLatBoundsorTLcdXYBounds.getPointCount()andgetPoint(int)).- 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
-
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.
-