public class TLcdASTERIXTrack extends TLcdLonLatHeightPoint implementsILcdFeatured, ILcdOriented, ILcdDataObject
TLcdASTERIXTrajectory
. It represents the
location, heading and properties of the TLcdASTERIXTrajectory
at a
given index.
A TLcdASTERIXTrajectory
represents the whole path of an
aircraft, including a location and additional information (the properties of its TLcdDataType
) for
every timestamp. This TLcdASTERIXTrack
object however
represents an aircraft at a certain time/position, so it represents a
TLcdASTERIXTrajectory
at a given index.
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 TLcdASTERIXTrack
, one should either:
updateForIndex(int)
to update the state of this track to a
given index (both the properties of its TLcdDataType
and its location). Note that the method
TLcdASTERIXTrajectory.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.
Constructor and Description |
---|
TLcdASTERIXTrack(TLcdASTERIXTrajectory aTrajectory)
Constructs a new
TLcdASTERIXTrack that has a reference to a
TLcdASTERIXTrajectory . |
Modifier and Type | Method and Description |
---|---|
boolean |
canSetFeature(int aIndex)
Checks whether the specified feature is editable.
|
boolean |
equals(Object aObject)
Checks whether the object has the same class as this object and whether the coordinates are
equal or differ by 360 for longitudes.
|
TLcdDataType |
getDataType()
Returns the type of this data object.
|
Object |
getFeature(int i)
Returns the feature object on index i from the current trajectory point.
|
int |
getFeatureCount()
Returns the number of features.
|
double |
getOrientation()
Returns the heading of the track that corresponds to
getTrajectoryPointIndex() . |
TLcdASTERIXTrajectory |
getTrajectory()
Every
TLcdASTERIXTrack has a reference to exactly one TLcdASTERIXTrajectory . |
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()
The hash code of this shape is the hash code of its class, in order to
be consistent with the
ALcdShape.equals(Object) method. |
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 aIndex,
Object aObject)
Sets the feature
Object at the given index. |
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.
|
String |
toString() |
void |
updateForIndex(int aTrajectoryPointIndex)
Updates the state of this track so that it reflects the state of the trajectory at the given
aTrajectoryPointIndex.
|
cloneAs2DEditableBounds, cloneAs2DEditablePoint, cloneAs3DEditableBounds, cloneAs3DEditablePoint, contains2D, contains2D, getCosX, getCosY, getHeight, getLat, getLon, getSinX, getSinY, getTanX, getTanY, getX, getY, getZ, interacts2D, move3D
move2D, move3D, translate3D
move2D, translate2D
contains2D, contains3D, contains3D, contains3D, getBounds, getDepth, getFocusPoint, getLocation, getMaxX, getMaxY, getMaxZ, getMinX, getMinY, getMinZ, getPoint, getPointCount, getWidth, interacts2D, interacts3D, interacts3D, isDefined
clone, contains2D, contains3D, fromDomainObject
finalize, getClass, notify, notifyAll, wait, wait, wait
move3D, translate3D
move2D, move2D, translate2D
contains2D, contains3D, contains3D, getFocusPoint
getBounds
clone
getPointSFCT, getX, getY, getZ
getCenter
public TLcdASTERIXTrack(TLcdASTERIXTrajectory aTrajectory)
TLcdASTERIXTrack
that has a reference to a
TLcdASTERIXTrajectory
.aTrajectory
- The TLcdASTERIXTrajectory
on which this
TLcdASTERIXTrack
is based.public int getTrajectoryPointIndex()
public void setTrajectoryPointIndex(int aPointIndex)
TLcdASTERIXTrajectory.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. Set this to -1 to mark the track as inactive.public void updateForIndex(int aTrajectoryPointIndex)
Updates the state of this track so that it reflects the state of the trajectory at the given aTrajectoryPointIndex.
It updates the properties similarly to setTrajectoryPointIndex(int)
, but it also
updates the location of this track, according to the given point index.
Note that the method TLcdASTERIXTrajectory.getIndexForTimeStamp(long)
can be used to retrieve the index for a given time value.
aTrajectoryPointIndex
- The point index of the trajectory, 0 <= aTrajectoryPointIndex
<= getTrajectory().getPointCount()public int getFeatureCount()
ILcdFeatured
getFeatureCount
in interface ILcdFeatured
public Object getFeature(int i) throws IndexOutOfBoundsException
getTrajectory().getTrackFeature( getTrajectoryPointIndex(), i )
.getFeature
in interface ILcdFeatured
i
- The index of the feature, must be smaller than getFeatureCount()
.IndexOutOfBoundsException
ILcdFeatured.setFeature(int, java.lang.Object)
public boolean canSetFeature(int aIndex)
ILcdFeatured
canSetFeature
in interface ILcdFeatured
aIndex
- a valid feature index.public void setFeature(int aIndex, Object aObject) throws IllegalArgumentException
ILcdFeatured
Object
at the given index.setFeature
in interface ILcdFeatured
aIndex
- a valid feature index.aObject
- the new feature Object
.IllegalArgumentException
- if the feature can't be set.ILcdFeatured.getFeature(int)
,
ILcdFeatured.canSetFeature(int)
public TLcdASTERIXTrajectory getTrajectory()
TLcdASTERIXTrack
has a reference to exactly one TLcdASTERIXTrajectory
.TLcdASTERIXTrajectory
that is referenced by this TLcdASTERIXTrack.public boolean isActive()
getTrajectoryPointIndex()
!= -1.public double getOrientation()
getTrajectoryPointIndex()
.getOrientation
in interface ILcdOriented
getTrajectoryPointIndex()
. If the
track is not active, will return Double.NaN
public boolean equals(Object aObject)
TLcdLonLatHeightPoint
equals
in interface ILcdPoint
equals
in class TLcdLonLatHeightPoint
aObject
- the object to check for equalitypublic int hashCode()
ALcdShape
ALcdShape.equals(Object)
method.
Extensions should refine this implementation, based on their properties.public String toString()
toString
in class ALcd3DEditablePoint
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 TLcdDataType getDataType()
ILcdDataObject
null
.getDataType
in interface ILcdDataObject
public 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.