faa.tg.track
Class OffsetDist

java.lang.Object
  extended by faa.tg.track.Offset4D
      extended by faa.tg.track.OffsetDist
All Implemented Interfaces:
HasName, Filterable, ManagedObject, java.io.Serializable

public class OffsetDist
extends Offset4D

 OffsetDist stores an offset calculation that can be applied to
 PositionSimTime objects to obtain a new offset.
 
See the source: OffsetDist.java

Version:
$Id: OffsetDist.java,v 1.6 2008/09/11 20:04:53 lykensj Exp $
Author:
Dana N. Whicker, TGF/Engility Corp, Apr 18, 2007
See Also:
Serialized Form

Field Summary
static java.lang.String CVS_VERSION_ID
          The CVS Version ID.
private  java.lang.String name
           
static java.lang.String NAME_PREFIX
           
private static java.text.DecimalFormat OFFSET_FORMAT
           
private  TrueBearing offsetBearing
           
private  Distance offsetDist
           
private  java.lang.String offsetText
           
private  TrueBearing recipBearing
           
(package private) static long serialVersionUID
           
 
Fields inherited from class faa.tg.track.Offset4D
NAME_IDX, subOffset
 
Constructor Summary
OffsetDist(Distance distToFollow)
          Constructs an offset that can be applied to a Track or a PositionSimTime.
OffsetDist(Distance dist, TrueBearing dir)
          Deprecated. Not needed?
OffsetDist(Distance dist, TrueBearing offsetBearing, Offset4D subOffset)
          Constructs an offset that can be applied to a Track or a PositionSimTime.
 
Method Summary
 Trace4D calcOffset(Trace4D point)
          Calculates and returns the offset to the specified 4D point.
 java.lang.String getName()
          Returns a name uniquely identifying this offset.
 Distance getOffsetDist()
          Returns the offset distance.
 java.lang.String getOffsetText()
          Returns the offset distance text in the format:
 RouteSegment getRouteSegment(Track track, Position estPos)
          Returns the points of the path flanking the specified time as a RouteSegment; if the time is before the first point, returns the first route segment; if the time is after the last point, returns null.
 boolean isTooFar(Aircraft follower, Aircraft leader, double maxPercentage)
          Returns whether one aircraft is too far from another aircraft
 
Methods inherited from class faa.tg.track.Offset4D
apply, calcOffset, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

CVS_VERSION_ID

public static final java.lang.String CVS_VERSION_ID
The CVS Version ID.

See Also:
Constant Field Values

OFFSET_FORMAT

private static final java.text.DecimalFormat OFFSET_FORMAT

NAME_PREFIX

public static final java.lang.String NAME_PREFIX
See Also:
Constant Field Values

offsetBearing

private final TrueBearing offsetBearing

recipBearing

private final TrueBearing recipBearing

offsetDist

private final Distance offsetDist

name

private final java.lang.String name

offsetText

private final java.lang.String offsetText
Constructor Detail

OffsetDist

public OffsetDist(Distance dist,
                  TrueBearing dir)
Deprecated. Not needed?

Constructs an offset that can be applied to a Track or a PositionSimTime.


OffsetDist

public OffsetDist(Distance dist,
                  TrueBearing offsetBearing,
                  Offset4D subOffset)
Constructs an offset that can be applied to a Track or a PositionSimTime.


OffsetDist

public OffsetDist(Distance distToFollow)
Constructs an offset that can be applied to a Track or a PositionSimTime.

Method Detail

getName

public java.lang.String getName()
Returns a name uniquely identifying this offset.

Specified by:
getName in interface ManagedObject
Specified by:
getName in class Offset4D
Returns:
Returns the name of the object.

getOffsetText

public java.lang.String getOffsetText()
Returns the offset distance text in the format:

" at 0.0## nautical miles".

Specified by:
getOffsetText in class Offset4D

calcOffset

public Trace4D calcOffset(Trace4D point)
Calculates and returns the offset to the specified 4D point.

Specified by:
calcOffset in class Offset4D
Parameters:
point - The 4D point to offset.

getOffsetDist

public Distance getOffsetDist()
Returns the offset distance.


getRouteSegment

public RouteSegment getRouteSegment(Track track,
                                    Position estPos)
Returns the points of the path flanking the specified time as a RouteSegment; if the time is before the first point, returns the first route segment; if the time is after the last point, returns null. (A RouteSegment contains LatLonFix objects.)

Specified by:
getRouteSegment in class Offset4D

isTooFar

public boolean isTooFar(Aircraft follower,
                        Aircraft leader,
                        double maxPercentage)
Returns whether one aircraft is too far from another aircraft

Specified by:
isTooFar in class Offset4D
Parameters:
follower - - the aircraft that was told to follow
leader - - the aircraft being followed
maxPercentage - - the maximum percent of the offset to allow
Returns:
true if too far from each other, otherwise false.