faa.tg.dra.tools
Class DistFactory

java.lang.Object
  extended by faa.tg.filters.AbstractFilter
      extended by faa.tg.dra.tools.DistFactory
All Implemented Interfaces:
DoesFinal, Filter, FilterableListener, java.io.Serializable, java.util.EventListener
Direct Known Subclasses:
ClosestACFactory, SiteDistanceFactory, ViolationSepFactory, VortexSepFactory

public abstract class DistFactory
extends AbstractFilter
implements DoesFinal

 DistFactory allows the selection of a type of distance information to
 be sent as a report.  The objects received must be in time sorted order
 (use TimeFilter with sort option).  The objects the report operates on
 are selected by the report type.  The report information (output as
 DistSecond objects) contains distance information on the objects selected
 and information about the objects.  For more selectivity on the distance
 information produced, use NameDistFactory or SingleDistFactory.
 
 DistFactory is a FilterableListener and an AbstractFilter; it listens for
 Filterables, and selects the events that are needed to construct a new
 event containing distance information from an airplane to another object.
 This event is then sent to listeners registered to itself.
 If DistSecond objects must report navigation status information,
 DistFactory should be listening on a source providing Filterables that
 implement the HasNav interface.
 
See the source: DistFactory.java

Version:
$Id: DistFactory.java,v 3.4 2008/10/29 20:44:26 danaw Exp $
Author:
Dana N. Whicker, FAA/ACT-510 Tue Aug 10 14:18:00 EST 1999, Jullia Moore, TGF/Titan Corp, Feb 4, 2004
See Also:
ViolationSepFactory, VortexSepFactory, ClosestACFactory, SiteDistanceFactory, Serialized Form

Field Summary
protected  int acPassType
          Which type of aircraft to send on: default is ALL_AIRCRAFT.
static int ALL_AIRCRAFT
          Type of aircraft pass through: filter sends on all aircraft.
static java.lang.String CVS_VERSION_ID
          The CVS Version ID
static int DISTANCE_MATCH
          Type of aircraft pass through: filter sends aircraft stored in DistSecond objects in addition to sending DistSecond objects.
private  java.util.List<java.lang.String> distMatchSent
           
static Distance MIN_AC_SEP
          Default minimum horizontal aircraft separation is 3 n miles.
static Distance MIN_ALT_SEP
          Default minimum vertical separation for aircraft is 1000 feet.
static Distance MIN_SITE_DIST
          Default minimum distance to report for a fix is 0.5 n miles.
 Distance minSiteDist
          Reporting distance for non-moving objects.
static int NO_AIRCRAFT
          Type of aircraft pass through: filter sends no aircraft.
(package private) static long serialVersionUID
           
protected  SimulationTime simTime
           
private  java.lang.String typeTitle
          Type title to identify the subclass of DistFactory (same parameter that is used to construct DistSecond).
 
Fields inherited from class faa.tg.filters.AbstractFilter
DEFAULT_PASS_THROUGH, listeners, passThrough
 
Constructor Summary
DistFactory(java.lang.String typeTitle)
          Constructs the DistFactory object.
DistFactory(java.lang.String typeTitle, boolean passThrough)
          Deprecated. Specify both acPassType and passThrough instead.
DistFactory(java.lang.String typeTitle, int acPassType, boolean passThrough)
          Constructs the DistFactory object; sets passThrough indicating whether to send objects read in (if false, only sends the DistSeconds created).
 
Method Summary
 void doFinal()
          Provided so subclasses of DistFactory can perform special handling for reports that require special processing at the end of the sim, such as calculating the total distance information received.
 void fire(Filterable evt)
          Redefines fire() to send on objects when the aircraft pass type is DISTANCE_MATCH.
 int getAcPassType()
          Returns aircraft passthrough type that specifies which aircraft are forwarded on by this filter.
 java.lang.String getTypeTitle()
          Returns type title that identifies the subclass of DistFactory; is a parameter used to create DistSecond.
 void handleObject(Filterable evt)
          Must be redefined for a subclass to return DistSecond objects: this can be called by the subclass to handle received objects according to the passThrough setting and to handle SimTerminationEvents.
 void setAcPassType(int acPassType)
           
 
Methods inherited from class faa.tg.filters.AbstractFilter
addFilterableListener, getPassThrough, removeFilterableListener, setPassThrough, substituteFileVariables
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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

MIN_SITE_DIST

public static final Distance MIN_SITE_DIST
Default minimum distance to report for a fix is 0.5 n miles.


MIN_AC_SEP

public static final Distance MIN_AC_SEP
Default minimum horizontal aircraft separation is 3 n miles.


MIN_ALT_SEP

public static final Distance MIN_ALT_SEP
Default minimum vertical separation for aircraft is 1000 feet.


ALL_AIRCRAFT

public static final int ALL_AIRCRAFT
Type of aircraft pass through: filter sends on all aircraft.

See Also:
Constant Field Values

DISTANCE_MATCH

public static final int DISTANCE_MATCH
Type of aircraft pass through: filter sends aircraft stored in DistSecond objects in addition to sending DistSecond objects.

See Also:
Constant Field Values

NO_AIRCRAFT

public static final int NO_AIRCRAFT
Type of aircraft pass through: filter sends no aircraft.

See Also:
Constant Field Values

typeTitle

private java.lang.String typeTitle
Type title to identify the subclass of DistFactory (same parameter that is used to construct DistSecond).

See Also:
DistSecond

simTime

protected SimulationTime simTime

minSiteDist

public Distance minSiteDist
Reporting distance for non-moving objects.


acPassType

protected int acPassType
Which type of aircraft to send on: default is ALL_AIRCRAFT.


distMatchSent

private java.util.List<java.lang.String> distMatchSent
Constructor Detail

DistFactory

public DistFactory(java.lang.String typeTitle)
Constructs the DistFactory object.


DistFactory

public DistFactory(java.lang.String typeTitle,
                   int acPassType,
                   boolean passThrough)
Constructs the DistFactory object; sets passThrough indicating whether to send objects read in (if false, only sends the DistSeconds created).

Parameters:
acPassType - A type value indicating which aircraft types to send.
passThrough - Whether to send non-aircraft objects read in.

DistFactory

public DistFactory(java.lang.String typeTitle,
                   boolean passThrough)
Deprecated. Specify both acPassType and passThrough instead.

Constructs the DistFactory object; sets passThrough indicating whether to send objects read in (if false, only sends the DistSeconds created). THIS IS PROVIDED FOR BACKWARD COMPATIBILITY: if passThrough is set to true, it is equivalent to ALL_AIRCRAFT and passThrough turned on; if passThrough is set to false, it is equivalent to NO_AIRCRAFT and passThrough turned off.

Method Detail

getAcPassType

public int getAcPassType()
Returns aircraft passthrough type that specifies which aircraft are forwarded on by this filter.


setAcPassType

public void setAcPassType(int acPassType)

getTypeTitle

public java.lang.String getTypeTitle()
Returns type title that identifies the subclass of DistFactory; is a parameter used to create DistSecond.


doFinal

public void doFinal()
Provided so subclasses of DistFactory can perform special handling for reports that require special processing at the end of the sim, such as calculating the total distance information received.

Specified by:
doFinal in interface DoesFinal

fire

public void fire(Filterable evt)
Redefines fire() to send on objects when the aircraft pass type is DISTANCE_MATCH.

Specified by:
fire in interface Filter
Overrides:
fire in class AbstractFilter
Parameters:
evt - The event containing the filter event.

handleObject

public void handleObject(Filterable evt)
Must be redefined for a subclass to return DistSecond objects: this can be called by the subclass to handle received objects according to the passThrough setting and to handle SimTerminationEvents.

Specified by:
handleObject in interface FilterableListener
Specified by:
handleObject in class AbstractFilter
Parameters:
evt - The event containing the DR&A object.