public class TLcdASDITrajectory extends Object implements ILcdPointList,ILcdPointList2, ILcdBounded,ILcdFeatured, ILcdCache, ILcdTimeBounded, ILcdDataObject
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.Modifier and Type | Method and Description |
---|---|
boolean |
canSetFeature(int aFeatureIndex)
Checks whether the specified feature is editable.
|
void |
clearCache()
Clears the cache.
|
long |
getBeginTime()
This method acts as a shortcut method call to retrieve the begin
time of the time bounds from
getTimeBounds() . |
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()
This method acts as a shortcut method call to retrieve the end
time of the time bounds from
getTimeBounds() . |
Object |
getFeature(int aFeatureIndex)
Returns the feature
Object at the given index. |
int |
getFeatureCount()
Returns the number of features.
|
TLcdASDIFlightPlanHistory |
getFlightPlanHistory()
Returns the flight plan history associated with this trajectory.
|
int |
getIndexForTimeStamp(long aTimeStamp)
Finds the index that corresponds to the given timestamp.
|
ILcdPoint |
getPoint(int aIndex)
Returns the
ILcdPoint at a given index. |
int |
getPointCount()
Returns the number of
ILcdPoint objects in the list. |
void |
getPointSFCT(int aIndex,
ILcd3DEditablePoint aPointSFCT)
Stores the coordinates of the point at
aIndex in the given point. |
long |
getTime(int aIndex)
Returns the time corresponding to the point
getPoint(aIndex) . |
ILcdTimeBounds |
getTimeBounds()
Returns the
ILcdTimeBounds by which this object is bounded. |
Object |
getTrackFeature(int aIndex,
int aFeatureIndex)
Retrieves the track feature indicated by aFeatureIndex at the point indicated by aIndex.
|
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. |
Object |
getTrackValue(int aIndex,
TLcdDataProperty aProperty)
Gets the value of a track property related to this trajectory.
|
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.
|
double |
getX(int aIndex)
Returns the X coordinate of the point at
aIndex . |
double |
getY(int aIndex)
Returns the Y coordinate of the point at
aIndex . |
double |
getZ(int aIndex)
Returns the Z coordinate of the point at
aIndex . |
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.
|
public TLcdASDIFlightPlanHistory getFlightPlanHistory()
null
if no flight plan history information is available.null
.public long getTime(int aIndex)
getPoint(aIndex)
. It is
specified as a value in milliseconds since 1970, similar to Date.getTime()
.aIndex
- The index of the point for which you want to know the time. This index corresponds
to the index in getPoint(int)
public int getIndexForTimeStamp(long aTimeStamp)
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.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()
getTimeBounds()
.getTimeBounds()
public long getEndTime()
getTimeBounds()
.getTimeBounds()
public int getPointCount()
ILcdPointList
ILcdPoint
objects in the list.getPointCount
in interface ILcdPointList
ILcdPoint
objects in the list.public ILcdPoint getPoint(int aIndex) throws IndexOutOfBoundsException
ILcdPointList
ILcdPoint
at a given index.getPoint
in interface ILcdPointList
aIndex
- a valid index in the list of ILcdPoint
objects.ILcdPoint
at the given index.IndexOutOfBoundsException
- if the given index is out of bounds.public void getPointSFCT(int aIndex, ILcd3DEditablePoint aPointSFCT)
ILcdPointList
aIndex
in the given point.getPointSFCT
in interface ILcdPointList
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.public double getX(int aIndex)
ILcdPointList
aIndex
.getX
in interface ILcdPointList
aIndex
- the index of the point for which to return the X coordinate.aIndex
.public double getY(int aIndex)
ILcdPointList
aIndex
.getY
in interface ILcdPointList
aIndex
- the index of the point for which to return the Y coordinate.aIndex
.public double getZ(int aIndex)
ILcdPointList
aIndex
.getZ
in interface ILcdPointList
aIndex
- the index of the point for which to return the Z coordinate.aIndex
.public int getFeatureCount()
See getFeature(int)
for more info on trajectory 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 tracks
(and associated messages) in a TLcdASDITrajectory
.
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 trajectory 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 trajectory features.
None of the features are editable, so always returns false
canSetFeature
in interface ILcdFeatured
aFeatureIndex
- a valid feature index.public int getTrackFeatureCount()
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.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.public Object getTrackFeature(int aIndex, int aFeatureIndex) throws IndexOutOfBoundsException
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.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()
.null
when the index is invalid.IndexOutOfBoundsException
- When aFeatureIndex is greater than or equal to getTrackFeatureCountpublic Object getTrackValue(int aIndex, TLcdDataProperty aProperty)
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()
.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.null
when the index is
invalid.IllegalArgumentException
- when the given property does not match the correct track type.public ILcdBounds getBounds()
ILcdBounded
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
.
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