public class TLcdASDIFlightPlanHistory extends Object implements ILcdPointList, ILcdBounded,ILcdFeatured, ILcdCache, ILcdTimeBounded, ILcdDataObject
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.Modifier and Type | Method and Description |
---|---|
boolean |
canSetFeature(int aFeatureIndex)
Checks whether the specified feature is editable.
|
void |
clearCache()
Clears the cache.
|
long |
getBeginTime()
Returns the begin time of this
TLcdASDIFlightPlanHistory . |
ILcdBounds |
getBounds()
Returns the
ILcdBounds by which the geometry of this ILcdBounded object
is bounded. |
Object |
getCachedObject(Object aKey)
Looks up and returns the cached Object corresponding to the given key.
|
TLcdDataType |
getDataType()
Returns the type of this data object.
|
long |
getEndTime()
Returns the end time of this
TLcdASDIFlightPlanHistory . |
Object |
getFeature(int aFeatureIndex)
Returns the feature
Object at the given index. |
int |
getFeatureCount()
Returns the number of features.
|
int |
getFlightPlanCount()
Returns the number of flight plans in this flight plan history.
|
Object |
getFlightPlanFeature(int aFlightPlanIndex,
int aFeatureIndex)
Retrieves the flight plan feature indicated by
aFeatureIndex
for the flight plan at index aFlightPlanIndex .
See ILcdASDIFlightPlanFeatures for more info on flight plan features. |
int |
getFlightPlanFeatureCount()
Returns the number of features in a flight plan.
See
ILcdASDIFlightPlanFeatures for more info on flight plan features. |
Object |
getFlightPlanValue(int aFlightPlanIndex,
TLcdDataProperty aProperty)
Gets the value of a flight plan property related to this flight plan history.
|
int |
getIndexForTimeStamp(long aTimeStamp)
Finds the index that corresponds to the given timestamp.
|
int |
getMessageCount()
Returns the number of messages in this flight plan history.
|
TLcdDataType |
getMessageDataType(int aMessageIndex)
Returns the
TLcdDataType of the message at the given index. |
Object |
getMessageFeature(int aMessageIndex,
int aFeatureIndex)
Retrieves the message feature indicated by
aFeatureIndex
for the message with index aMessageIndex .
See ILcdASDIFlightPlanMessageFeatures for more info on flight plan message features. |
int |
getMessageFeatureCount(int aMessageIndex)
Returns the number of features in the message with index
aMessageIndex . |
String |
getMessageType(int aMessageIndex)
Returns a
String indicating the type of the message with index aMessageIndex . |
Object |
getMessageValue(int aMessageIndex,
TLcdDataProperty aProperty)
Retrieves the value of the
TLcdDataProperty for a given message index. |
ILcdPoint |
getPoint(int aPointIndex)
Retrieves the position indicated by
aPointIndex in the most recent intended path. |
ILcdPoint |
getPoint(int aFlightPlanIndex,
int aPointIndex)
Retrieves the position indicated by
aPointIndex
in the intended path of the flight plan at index aFlightPlanIndex . |
int |
getPointCount()
Returns the number of points in the most recent intended path.
|
int |
getPointCount(int aFlightPlanIndex)
Returns the number of points in the intended path of the flight plan at index
aFlightPlanIndex . |
long |
getTime(int aFlightPlanIndex)
Returns the time that corresponds with flight plan
aFlightPlanIndex . |
ILcdTimeBounds |
getTimeBounds()
Returns the
ILcdTimeBounds by which this object is bounded. |
Object |
getValue(String aPropertyName)
Convenience method that returns the value of the property with the given name.
|
Object |
getValue(TLcdDataProperty aProperty)
Returns the value of the given property.
|
boolean |
hasValue(String aPropertyName)
Indicates whether this data object has a value for the given property.
|
boolean |
hasValue(TLcdDataProperty aProperty)
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.
|
Object |
removeCachedObject(Object aKey)
Looks up and removes the cached Object corresponding to the given key.
|
void |
setFeature(int aFeatureIndex,
Object aValue)
Sets the feature
Object at the given index. |
void |
setValue(String aPropertyName,
Object aValue)
Convenience method that sets the value of the property with the given name.
|
void |
setValue(TLcdDataProperty aProperty,
Object aValue)
Sets the value of the given property for this data object.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPointSFCT, getX, getY, getZ
public long getTime(int aFlightPlanIndex)
aFlightPlanIndex
.
It is specified as a value in milliseconds since 1970, similar to Date.getTime()
.aFlightPlanIndex
- The index of the flight plan for which you want to know the time.aFlightPlanIndex
.public int getIndexForTimeStamp(long aTimeStamp)
getTime( returned_index )
<= aTimeStamp < getTime(
returned_index + 1 )
. Note that if 'returned_index' equals getFlightPlanCount()
-1 (largest possible index), getTime(
returned_index )
== aTimeStamp.
If the given time stamp is not in the interval
[getBeginTime()
, getEndTime()
],
-1 is returned.aTimeStamp
- The timestamp for which the index is requested.getTime(int)
public ILcdTimeBounds getTimeBounds()
ILcdTimeBounded
ILcdTimeBounds
by which this object is bounded.getTimeBounds
in interface ILcdTimeBounded
ILcdTimeBounds
by which this object is bounded.public long getBeginTime()
TLcdASDIFlightPlanHistory
.
The begin time corresponds with the first time the associated flight plan
is known to be active.
The long value is defined as in Date.getTime()
.
This method acts as a shortcut method call to retrieve the begin
time of the time bounds from getTimeBounds()
.getTimeBounds()
public long getEndTime()
TLcdASDIFlightPlanHistory
.
The end time corresponds with the last time the associated flight plan
is known to be active.
The long value is defined as in Date.getTime()
This method acts as a shortcut method call to retrieve the begin
time of the time bounds from getTimeBounds()
.getTimeBounds()
public int getMessageCount()
getMessageCount()
and getFlightPlanCount()
therefor always give the same result and can be used interchangeable.getMessageFeatureCount(int)
,
getMessageFeature(int, int)
,
getMessageType(int)
public int getMessageFeatureCount(int aMessageIndex)
aMessageIndex
.
See ILcdASDIFlightPlanMessageFeatures
for more info on flight plan message features.aMessageIndex
- The index of the message for which you want to know the feature count.
Must be smaller than getMessageCount()
.getMessageFeature(int, int)
public Object getMessageFeature(int aMessageIndex, int aFeatureIndex)
aFeatureIndex
for the message with index aMessageIndex
.
See ILcdASDIFlightPlanMessageFeatures
for more info on flight plan message features.aMessageIndex
- The index of the message for which you want to know the feature value.
Must be smaller than getMessageCount()
.aFeatureIndex
- Determines what particular feature value you want to retrieve. Must be
smaller than getMessageFeatureCount(int)
.public Object getMessageValue(int aMessageIndex, TLcdDataProperty aProperty)
TLcdDataProperty
for a given message index.
The data property must be of the correct data type. To find the data type, use the
getMessageDataType(int)
method. The properties for all data types returned by this method
are described in TLcdASDIMessageDataTypes
.aMessageIndex
- The index of the message for which you want to know the property value.
Must be smaller than getMessageCount()
.aProperty
- a TLcdDataProperty
that was declared in the data type returned by
getMessageDataType(int)
IllegalArgumentException
- when the given data property was not declared in the TLcdDataType
of the message. To make sure this does not happen, use getMessageDataType(int)
to obtain
the data type of the message beforehand.for more info on the properties and data types of a message
public String getMessageType(int aMessageIndex)
String
indicating the type of the message with index aMessageIndex
.
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 the String
"FZ".aMessageIndex
- The index of the message for which you want to know the type.
Must be smaller than getMessageCount()
.String
indicating the type of the specified message, null if not known.public TLcdDataType getMessageDataType(int aMessageIndex)
TLcdDataType
of the message at the given index. This data type
will be supertyped by TLcdASDIMessageDataTypes.AbstractASDIMessageType
, and will be
one of the TLcdDataType
instances found in the TLcdASDIMessageDataTypes
class.aMessageIndex
- The index of the message for which you want to know the type.
Must be smaller than getMessageCount()
.TLcdDataType
of the message, of null if not known.TLcdASDIMessageDataTypes
public int getFlightPlanCount()
getMessageCount()
and getFlightPlanCount()
therefor always give the same result and can be used interchangeable.public int getFlightPlanFeatureCount()
ILcdASDIFlightPlanFeatures
for more info on flight plan features.getFlightPlanFeature(int, int)
public Object getFlightPlanFeature(int aFlightPlanIndex, int aFeatureIndex)
aFeatureIndex
for the flight plan at index aFlightPlanIndex
.
See ILcdASDIFlightPlanFeatures
for more info on flight plan features.aFlightPlanIndex
- The index of the flight plan for which you want to know the feature value.
Must be smaller than getFlightPlanCount()
.aFeatureIndex
- Determines what particular feature value you want to retrieve. Must be
smaller than getFlightPlanFeatureCount()
.aFlightPlanIndex
.public Object getFlightPlanValue(int aFlightPlanIndex, TLcdDataProperty aProperty)
TLcdASDIFlightPlanDataTypes
.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 from TLcdASDIFlightPlanDataTypes
null
when the index is
invalid.IllegalArgumentException
- when the given property is not declared in the
flight plan TLcdDataType
.public int getFeatureCount()
See getFeature(int)
for more info on flight plan history features.
getFeatureCount
in interface ILcdFeatured
public Object getFeature(int aFeatureIndex) throws IndexOutOfBoundsException
Object
at the given index.
Only one feature is available : the id that links together all flight plans
(and their messages) in a TLcdASDIFlightPlanHistory
.
getFeature
in interface ILcdFeatured
aFeatureIndex
- a valid feature index.Object
at the given index.IndexOutOfBoundsException
- when an index is chosen greater than the result of getFeatureCount.ILcdFeatured.setFeature(int, java.lang.Object)
public void setFeature(int aFeatureIndex, Object aValue) throws IllegalArgumentException
Object
at 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
.
setFeature
in interface ILcdFeatured
aFeatureIndex
- a valid feature index.aValue
- the new feature Object
.IllegalArgumentException
- if the feature can't be set.ILcdFeatured.getFeature(int)
,
ILcdFeatured.canSetFeature(int)
public boolean canSetFeature(int aFeatureIndex)
See getFeature(int)
for more info on flight plan history features.
None of the features are editable, so always returns false
canSetFeature
in interface ILcdFeatured
aFeatureIndex
- a valid feature index.public int getPointCount(int aFlightPlanIndex)
aFlightPlanIndex
.aFlightPlanIndex
- The index of the flight plan for which you want to know the intended path.
Must be smaller than getFlightPlanCount()
.aFlightPlanIndex
.getPoint(int, int)
public ILcdPoint getPoint(int aFlightPlanIndex, int aPointIndex) throws IndexOutOfBoundsException
aPointIndex
in the intended path of the flight plan at index aFlightPlanIndex
.aFlightPlanIndex
- The index of the flight plan for which you want to know the intended path position.
Must be smaller than getFlightPlanCount()
.aPointIndex
- Determines what particular point you want to retrieve. Must be
smaller than getPointCount(int)
.aFlightPlanIndex
.IndexOutOfBoundsException
- when the point index is greater than or equal to getPointCountpublic int getPointCount()
getPointCount(getFlightPlanCount() - 1)
and
getPoint(getFlightPlanCount() - 1, aPointIndex)
.getPointCount
in interface ILcdPointList
getPoint(int)
public ILcdPoint getPoint(int aPointIndex) throws IndexOutOfBoundsException
aPointIndex
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 by getPointCount(getFlightPlanCount() - 1)
and
getPoint(getFlightPlanCount() - 1, aPointIndex)
.getPoint
in interface ILcdPointList
aPointIndex
- Determines what particular point you want to retrieve. Must be
smaller than getPointCount()
.IndexOutOfBoundsException
- if the given index is out of bounds.public ILcdBounds getBounds()
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
.
getPointCount()
and getPoint(int)
).getBounds
in interface ILcdBounded
ILcdBounds
by which the geometry of this ILcdBounded
object
is bounded.public void insertIntoCache(Object aKey, Object aObject)
ILcdCache
insertIntoCache
in interface ILcdCache
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.public Object getCachedObject(Object aKey)
ILcdCache
getCachedObject
in interface ILcdCache
aKey
- the key Object that was used for storing the cache Object.public Object removeCachedObject(Object aKey)
ILcdCache
removeCachedObject
in interface ILcdCache
aKey
- the key Object that was used for storing the cache Object.public void clearCache()
ILcdCache
clearCache
in interface ILcdCache
public TLcdDataType getDataType()
ILcdDataObject
null
.getDataType
in interface ILcdDataObject
public Object getValue(TLcdDataProperty aProperty)
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.
getValue
in interface ILcdDataObject
aProperty
- the property for which the value is to be returnedpublic void setValue(TLcdDataProperty aProperty, Object aValue)
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 an IllegalArgumentException
.setValue
in interface ILcdDataObject
aProperty
- the property for which the value is to be setaValue
- the value to setTLcdDataType.getProperty(String)
public Object getValue(String aPropertyName)
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.getValue
in interface ILcdDataObject
aPropertyName
- the name of the property of which the value is to be returnedTLcdDataType.getProperty(String)
public void setValue(String aPropertyName, Object aValue)
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.setValue
in interface ILcdDataObject
aPropertyName
- the name of the property of which the value is to be setaValue
- the value to setpublic boolean hasValue(TLcdDataProperty aProperty)
ILcdDataObject
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 IllegalArgumentExceptionaProperty
is null
: not allowed, you will get NullPointerExceptionhasValue
in interface ILcdDataObject
aProperty
- the property for which to return whether a value is present or not.true
if this data object has a value for the given property, false
otherwise.public boolean hasValue(String aPropertyName)
ILcdDataObject
ILcdDataObject.hasValue(TLcdDataProperty)
for more information.hasValue
in interface ILcdDataObject
aPropertyName
- the name of the property for which to return whether a value is present
or not.true
if this data object has a value for the property with the given name,
false
otherwise.