Class TLcdASDIFlightPlan
- All Implemented Interfaces:
ILcdDataObject
,ILcdBounded
,ILcdPointList
,ILcdCache
,ILcdFeatured
,Serializable
,Cloneable
TLcdASDIFlightPlanHistory
. It represents the
intended route and flight plan features of the TLcdASDIFlightPlanHistory
at a
certain index.
A TLcdASDIFlightPlanHistory
represents the whole history of a
flight plan, including an intended route and additional information (=features) for
every timestamp. This TLcdASDIFlightPlan
however
represents a flight plan of a TLcdASDIFlightPlanHistory
at a certain time,
so it represents a TLcdASDIFlightPlanHistory
at a certain index.
All data made available by a TLcdASDIFlightPlan
is in fact
extracted from the TLcdASDIFlightPlanHistory
on which the
TLcdASDIFlightPlan
is based.
The history can be retrieved using getFlightPlanHistory()
, the index
in the history with getFlightPlanHistoryIndex()
.
The method isActive()
allows to check if a flight plan is active.
A flight plan is considered active when it has a valid history index.
Use setFlightPlanHistoryIndex(int)
to update the state of a flight plan to a given index.
Note that the method TLcdASDIFlightPlanHistory.getIndexForTimeStamp(long)
can
be used to retrieve the index for a given time value.
The properties of a flight plan can be accessed through the ILcdDataObject
interface. The data type of a track will be TLcdASDIFlightPlanDataTypes.FlightPlanType
.
The values of the properties can be retrieved using the
ILcdDataObject.getValue(com.luciad.datamodel.TLcdDataProperty)
method. The property values
of a message can be accessed using the getMessageType(int)
and
getMessageValue(int, com.luciad.datamodel.TLcdDataProperty)
methods. The message type will be one of the data types found in TLcdASDIMessageDataTypes
.
The flight plan properties can also be accessed through the ILcdFeatured
interface. The features of the flight plan messages that make up the flight plan
can be accessed through the methods getMessageCount()
,
getMessageFeatureCount(int)
and getMessageFeature(int, int)
.
An overview of all flight plan features can be found in ILcdASDIFlightPlanFeatures
and of all flight plan message features in ILcdASDIFlightPlanMessageFeatures
. Note that
the ILcdFeatured
interface only exists for backwards compatibility. It is recommended
to use the ILcdDataObject
instead, as described in the previous paragraph.
Models with TLcdASDIFlightPlan
objects have model descriptors that are
TLcdASDIFlightPlanModelDescriptor
. They describe the features
(available through the ILcdFeatured
interface)
of the TLcdASDIFlightPlan
objects. Moreover they have a method
getMessageFeaturedDescriptor(String aMessageType)
that allows 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)
. - See Also:
-
Constructor Summary
ConstructorDescriptionTLcdASDIFlightPlan
(TLcdASDIFlightPlanHistory aFlightPlanHistory) Constructs a newTLcdASDIFlightPlan
that has a reference to aTLcdASDIFlightPlanHistory
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canSetFeature
(int aFeatureIndex) Checks whether the flight plan feature with indexaFeatureIndex
of the flight plan at the current flight plan history index is editable.void
Clears the cache.clone()
Creates a shallow clone of this flightplan.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.getFeature
(int aFeatureIndex) Returns the value of the flight plan feature at indexaFeatureIndex
for the flight plan at the current flight plan history index.int
Returns the number of flight plan features from the associated flight plan history.Returns theTLcdASDIFlightPlanHistory
for which thisTLcdASDIFlightPlan
shows a window.int
Returns the index for which this flight plan represents the flight plan history.int
Returns the number of messages in this flight plan.getMessageDataType
(int aMessageIndex) Returns theTLcdDataType
of the message at the given index.getMessageFeature
(int aMessageIndex, int aFeatureIndex) Retrieves the message feature indicated byaFeatureIndex
for the message with indexaMessageIndex
.int
getMessageFeatureCount
(int aMessageIndex) Returns the number of features in the message with indexaMessageIndex
.getMessageType
(int aMessageIndex) Returns aString
indicating the type of the message with indexaMessageIndex
.getMessageValue
(int aMessageIndex, TLcdDataProperty aProperty) Retrieves the value of theTLcdDataProperty
for a given message index.getPoint
(int aPointIndex) Retrieves the intended route position indicated byaPointIndex
.int
Returns the number of points in the intended route.getValue
(TLcdDataProperty aProperty) Returns the value of the given property.Convenience method that returns the value of the property with the given name.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.boolean
isActive()
Returns whether or not this flight plan is still active.removeCachedObject
(Object aKey) Looks up and removes the cached Object corresponding to the given key.void
setFeature
(int aFeatureIndex, Object aObject) Sets the value of the flight plan feature with indexaFeatureIndex
for the flight plan at the current flight plan history index.void
setFlightPlanHistoryIndex
(int aFlightPlanHistoryIndex) Updates the state of this flight plan so that it reflects the state of the flight plan history at the given aFlightPlanHistoryIndex.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.Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.shape.ILcdPointList
getPointSFCT, getX, getY, getZ
-
Constructor Details
-
TLcdASDIFlightPlan
Constructs a newTLcdASDIFlightPlan
that has a reference to aTLcdASDIFlightPlanHistory
.- Parameters:
aFlightPlanHistory
- TheTLcdASDIFlightPlanHistory
on which thisTLcdASDIFlightPlan
is based.
-
-
Method Details
-
getFlightPlanHistoryIndex
public int getFlightPlanHistoryIndex()Returns the index for which this flight plan represents the flight plan history.- Returns:
- the index for which this flight plan represents the flight plan history.
-
setFlightPlanHistoryIndex
public void setFlightPlanHistoryIndex(int aFlightPlanHistoryIndex) Updates the state of this flight plan so that it reflects the state of the flight plan history at the given aFlightPlanHistoryIndex.
It updates the features and the intended route of this flight plan, according to the given index.
Note that the method
TLcdASDIFlightPlanHistory.getIndexForTimeStamp(long)
can be used to retrieve the index for a given time value.- Parameters:
aFlightPlanHistoryIndex
- The flight plan index of the flight plan history, 0 <= aFlightPlanHistoryIndex < getFlightPlanCount(). Set this to -1 to mark the flight plan as inactive.
-
getFeatureCount
public int getFeatureCount()Returns the number of flight plan features from the associated flight plan history. So it is equivalent to
getFlightPlanHistory().getFlightPlanFeatureCount()
.See
TLcdASDIFlightPlanHistory.getFlightPlanFeatureCount()
for a more detailed description.- Specified by:
getFeatureCount
in interfaceILcdFeatured
- Returns:
- the number of flight plan features from the associated flight plan history.
-
getFeature
Returns the value of the flight plan feature at index
aFeatureIndex
for the flight plan at the current flight plan history index. So it is equivalent togetFlightPlanHistory().getFlightPlanFeature( getFlightPlanHistoryIndex(), aFeatureIndex )
.See
TLcdASDIFlightPlanHistory.getFlightPlanFeature(int aIndex, int aFeatureIndex)
for a more detailed description.- Specified by:
getFeature
in interfaceILcdFeatured
- Parameters:
aFeatureIndex
- The index of the feature, must be smaller thangetFeatureCount()
.- Returns:
- The feature object on index
aFeatureIndex
for the flight plan at the current flight plan history index. - Throws:
IndexOutOfBoundsException
- when an index is chosen greater than the result of getFeatureCount.- See Also:
-
canSetFeature
public boolean canSetFeature(int aFeatureIndex) Checks whether the flight plan feature with index
aFeatureIndex
of the flight plan at the current flight plan history index is editable.See
getFeatureCount()
andgetFeature(int aFeatureIndex)
for more information on flight plan features.None of the flight plan features are editable, so always returns
false
.- Specified by:
canSetFeature
in interfaceILcdFeatured
- Parameters:
aFeatureIndex
- a valid feature index, must be smaller thangetFeatureCount()
.- Returns:
- whether the specified feature is editable, always returns
false
.
-
setFeature
Sets the value of the flight plan feature with index
aFeatureIndex
for the flight plan at the current flight plan history index.See
getFeatureCount()
andgetFeature(int aFeatureIndex)
for more information on flight plan features.None of the flight plan features are editable, so calling this method always results in throwing an
IllegalArgumentException
.- Specified by:
setFeature
in interfaceILcdFeatured
- Parameters:
aFeatureIndex
- a valid feature index, must be smaller thangetFeatureCount()
.aObject
- the new value of the feature.- Throws:
IllegalArgumentException
- if the feature can't be set.- See Also:
-
getFlightPlanHistory
Returns the
TLcdASDIFlightPlanHistory
for which thisTLcdASDIFlightPlan
shows a window.A
TLcdASDIFlightPlan
represents a flight plan at a certain time and is implemented as aTLcdASDIFlightPlanHistory
at a certain index. EveryTLcdASDIFlightPlan
has a reference to exactly oneTLcdASDIFlightPlanHistory
.- Returns:
- The
TLcdASDIFlightPlanHistory
that is referenced by thisTLcdASDIFlightPlan
.
-
getPointCount
public int getPointCount()Returns the number of points in the intended route.- Specified by:
getPointCount
in interfaceILcdPointList
- Returns:
- the number of points in the intended route.
-
getPoint
Retrieves the intended route position indicated byaPointIndex
.- Specified by:
getPoint
in interfaceILcdPointList
- Parameters:
aPointIndex
- Determines what particular point you want to retrieve. Must be smaller thangetPointCount()
.- Returns:
- The requested intended route position.
- Throws:
IndexOutOfBoundsException
- if the given index is out of bounds.
-
getMessageCount
public int getMessageCount()Returns the number of messages in this flight plan.- Returns:
- the number of messages in this flight plan.
- See Also:
-
getMessageFeatureCount
public int getMessageFeatureCount(int aMessageIndex) Returns the number of features in the message with indexaMessageIndex
.- 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 byaFeatureIndex
for the message with indexaMessageIndex
.- 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 theTLcdDataProperty
for 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
- aTLcdDataProperty
that was declared in the data type returned bygetMessageDataType(int)
- Returns:
- The requested value for the specified message and message property, or null if the message index was out of bounds.
- Throws:
IllegalArgumentException
- when the given data property was not declared in theTLcdDataType
of the message. To make sure this does not happen, usegetMessageDataType(int)
to obtain the data type of the message beforehand.- See Also:
-
getMessageType
Returns aString
indicating 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
String
indicating the type of the specified message, null if not known.
-
getMessageDataType
Returns theTLcdDataType
of the message at the given index. This data type will be supertyped byTLcdASDIMessageDataTypes.AbstractASDIMessageType
, and will be one of theTLcdDataType
instances found in theTLcdASDIMessageDataTypes
class.- Parameters:
aMessageIndex
- The index of the message for which you want to know the type. Must be smaller thangetMessageCount()
.- Returns:
- the
TLcdDataType
of the message, of null if not known. - See Also:
-
getBounds
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
The bounds include the points of the intended route (accessable throughundefined
bounds. You can create undefined bounds using the default constructors ofTLcdLonLatBounds
orTLcdXYBounds
.getPointCount()
andgetPoint(int)
).- Specified by:
getBounds
in interfaceILcdBounded
- Returns:
- the
ILcdBounds
by which the geometry of thisILcdBounded
object is bounded.
-
isActive
public boolean isActive()Returns whether or not this flight plan is still active. A flight plan is considered active if its timestamp lies within theTLcdASDIFlightPlanHistory.getBeginTime
andTLcdASDIFlightPlanHistory.getEndTime
, this is, it represents the flight plan history at a certain valid index. The data of an inactive flight plan should not be used or interpreted in any way.- Returns:
- true if this flight plan represents the flight plan history at a certain valid index, false if not.
-
clone
Creates a shallow clone of this flightplan. The flightplan history will be shared between this instance and the cloned instance.
-
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
-
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.
-