public class TLcdASDITrack extends TLcdLonLatHeightPoint implementsILcdFeatured, ILcdDataObject
TLcdASDITrajectory
. It represents the
location and features of the TLcdASDITrajectory
at a
given index.
A TLcdASDITrajectory
represents the whole path of an
aircraft, including a location and additional information (=features) for
every timestamp. This TLcdASDITrack
object however
represents an aircraft at a certain time/position. It is implemented as
a TLcdASDITrajectory
at a given index.
All data made available by a TLcdASDITrack
is in fact
extracted from the TLcdASDITrajectory
on which the TLcdASDITrack
is based.
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 TLcdASDITrack
, one should either:
updateForIndex(int)
to update the state of this track to a given index. Note that the method
TLcdASDITrajectory.getIndexForTimeStamp(long)
can be used to retrieve the index for
a given time value.
setTrajectoryPointIndex(int)
.
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.
ILcdDataObject
interface. The data type of a track will be either TLcdASDITrackTODataTypes.TrackTOType
or
TLcdASDITrackTZDataTypes.TrackTZType
. The values of the properties can be retrieved using the
ILcdDataObject.getValue(com.luciad.datamodel.TLcdDataProperty)
method.
The message properties of a track can also be accessed through the
ILcdFeatured
interface. This is added for backwards compatibility, though it
recommended to use the new ILcdDataObject
instead.
An overview of all available TZ features can be found in ILcdASDITrackTZFeatures
and of all available TO features in ILcdASDITrackTOFeatures
.
Models with TLcdASDITrack
objects have model descriptors that are
TLcdASDITrackModelDescriptor
. They describe the features
(available through the ILcdFeatured
interface)
of the TLcdASDITrack
objects.
Constructor and Description |
---|
TLcdASDITrack(TLcdASDITrajectory aTrajectory)
Constructs a new
TLcdASDITrack that has a reference to a
TLcdASDITrajectory . |
Modifier and Type | Method and Description |
---|---|
boolean |
canSetFeature(int aFeatureIndex)
Checks whether the track feature with index
aFeatureIndex
of the current trajectory point is editable. |
Object |
clone()
Creates and returns a copy of this object.
|
boolean |
equals(Object aObject)
Returns whether the specified object is equal to this one.
|
TLcdDataType |
getDataType()
Returns the type of this data object.
|
Object |
getFeature(int aFeatureIndex)
Returns the value of the track feature at index
aFeatureIndex
for the current trajectory point. |
int |
getFeatureCount()
Returns the number of track features from the associated trajectory.
|
TLcdASDITrajectory |
getTrajectory()
Every
TLcdASDITrack has a reference to exactly one TLcdASDITrajectory . |
int |
getTrajectoryPointIndex()
Returns the index for which this track represents the 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.
|
int |
hashCode()
Returns a hash code value for the object.
|
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.
|
boolean |
isActive()
Returns whether or not this track is still active.
|
void |
setFeature(int aFeatureIndex,
Object aObject)
Sets the value of the track feature with index
aFeatureIndex
for the current trajectory point.
See getFeatureCount() and getFeature(int aFeatureIndex)
for more information on track features. |
void |
setTrajectoryPointIndex(int aPointIndex)
Sets the index for which this track represents the trajectory.
|
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.
|
void |
updateForIndex(int aPointIndex)
Updates the state of this track so that it reflects the state of the
trajectory at the given aPointIndex.
It updates the features similarly to
setTrajectoryPointIndex(int) , but it also
updates the location of this track, according to the given point index.
Note that the method TLcdASDITrajectory.getIndexForTimeStamp(long) can be used to retrieve
the index for a given time value. |
cloneAs2DEditableBounds, cloneAs2DEditablePoint, cloneAs3DEditableBounds, cloneAs3DEditablePoint, contains2D, contains2D, getCosX, getCosY, getHeight, getLat, getLon, getSinX, getSinY, getTanX, getTanY, getX, getY, getZ, interacts2D, move3D
move2D, move3D, toString, translate3D
move2D, translate2D
contains2D, contains3D, contains3D, contains3D, getBounds, getDepth, getFocusPoint, getLocation, getMaxX, getMaxY, getMaxZ, getMinX, getMinY, getMinZ, getPoint, getPointCount, getWidth, interacts2D, interacts3D, interacts3D, isDefined
contains2D, contains3D, fromDomainObject
finalize, getClass, notify, notifyAll, wait, wait, wait
move3D, translate3D
move2D, move2D, translate2D
contains2D, contains3D, contains3D, getFocusPoint
getBounds
getPointSFCT, getX, getY, getZ
getCenter
public TLcdASDITrack(TLcdASDITrajectory aTrajectory)
TLcdASDITrack
that has a reference to a
TLcdASDITrajectory
. It will be inactive after creation
((isActive()
returns false
).aTrajectory
- The TLcdASDITrajectory
on which this
TLcdASDITrack
is based. This should not be null
.public int getTrajectoryPointIndex()
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 TLcdASDITrajectory.getIndexForTimeStamp(long)
can be used to retrieve
the index for a given time value.
aPointIndex
- The index that corresponds to the point in the trajectory which this track
should represent, 0 <= aPointIndex < getTrajectory().getPointCount().
Set this to -1 to mark the track as inactive.public void updateForIndex(int aPointIndex)
setTrajectoryPointIndex(int)
, but it also
updates the location of this track, according to the given point index.
Note that the method TLcdASDITrajectory.getIndexForTimeStamp(long)
can be used to retrieve
the index for a given time value.aPointIndex
- The index that corresponds to the point in the trajectory which this track
should represent, 0 <= aPointIndex < getTrajectory().getPointCount().
Set this to -1 to mark the track as inactive.public int getFeatureCount()
Returns the number of track features from the associated trajectory.
So it is equivalent to getTrajectory().getTrackFeatureCount()
.
See TLcdASDITrajectory.getTrackFeatureCount()
for a more detailed
description.
getFeatureCount
in interface ILcdFeatured
public Object getFeature(int aFeatureIndex) throws IndexOutOfBoundsException
Returns the value of the track feature at index aFeatureIndex
for the current trajectory point. So it is equivalent to
getTrajectory().getTrackFeature( getTrajectoryPointIndex(), aFeatureIndex )
.
See TLcdASDITrajectory.getTrackFeature(int aIndex, int aFeatureIndex)
for a more detailed
description.
getFeature
in interface ILcdFeatured
aFeatureIndex
- The index of the feature, must be smaller than getFeatureCount()
.aFeatureIndex
from the current trajectory point.IndexOutOfBoundsException
- when an index is chosen greater than the result of getFeatureCount.ILcdFeatured.setFeature(int, java.lang.Object)
public boolean canSetFeature(int aFeatureIndex)
Checks whether the track feature with index aFeatureIndex
of the current trajectory point is editable.
See getFeatureCount()
and getFeature(int aFeatureIndex)
for more information on track features.
None of the track features are editable, so always returns false
.
canSetFeature
in interface ILcdFeatured
aFeatureIndex
- a valid feature index, must be smaller than getFeatureCount()
.false
.public void setFeature(int aFeatureIndex, Object aObject) throws IllegalArgumentException
aFeatureIndex
for the current trajectory point.
See getFeatureCount()
and getFeature(int aFeatureIndex)
for more information on track features.
None of the track features are editable, so calling this method always
results in throwing an IllegalArgumentException
.setFeature
in interface ILcdFeatured
aFeatureIndex
- a valid feature index, must be smaller than getFeatureCount()
.aObject
- the new value of the feature.IllegalArgumentException
- if the feature can't be set.ILcdFeatured.getFeature(int)
,
ILcdFeatured.canSetFeature(int)
public TLcdASDITrajectory getTrajectory()
TLcdASDITrack
has a reference to exactly one TLcdASDITrajectory
.TLcdASDITrajectory
that is referenced by this TLcdASDITrack.public boolean isActive()
TLcdASDITrajectory.getBeginTime
and TLcdASDITrajectory.getEndTime
,
this is, it represents the trajectory at a certain valid point.
The data of an inactive track should not be used or interpreted in any way.public Object clone()
clone
in interface ILcdCloneable
clone
in class ALcdShape
Object.clone()
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 boolean equals(Object aObject)
x.equals(y)
returns true
if and only if x
and y
refer to the same object.equals
in interface ILcdPoint
equals
in class TLcdLonLatHeightPoint
aObject
- the object to compare to.true
if the specified object is equal to this one, false
otherwise.