faa.tg.recording.state
Class FlightState

java.lang.Object
  extended by faa.tg.recording.state.State
      extended by faa.tg.recording.state.FlightState
All Implemented Interfaces:
DraStorable, TextWritable, HasAcid, HasArrRwy, HasBeaconCode, HasDepRwy, HasName, HasPosition, HasSimTime, Filterable, Recordable, ManagedObject, java.io.Serializable, java.lang.Cloneable

public class FlightState
extends State
implements DraStorable, HasAcid, HasArrRwy, HasDepRwy, HasPosition, TextWritable, HasBeaconCode

 The recordable state of the Flight object.
 
See the source FlightState.java

Version:
$Id: FlightState.java,v 3.8 2008/07/15 19:58:11 lykensj Exp $
Author:
David M. D'Auria
See Also:
Flight, Recordable, Serialized Form

Field Summary
private  Acid acid
           
private  AcType aircraftType
           
private  java.lang.String airLine
           
private  Runway arrRunway
           
private  int complexity
           
static java.lang.String CVS_VERSION_ID
          The CVS Version ID
private  Airport depAirport
           
private  AirportID depAirportID
           
private  Runway depRunway
           
private  java.lang.String filedRouteString
           
private  SimulationTime filedStartTime
           
private  Frequency frequency
           
private  Position pos
           
(package private) static long serialVersionUID
           
private  SimulationTime simTime
          The SimulationTime at which this state information was created.
private  SimulationTime startTime
           
private  Ufp ufp
           
 
Constructor Summary
FlightState(Acid acid, AcType acType, SimulationTime startTime, java.lang.String routeString, Ufp ufp, SimulationTime simTime, Runway arrRwy, Airport depAirport, Runway depRwy)
          Creates the FlightState with a standard set of initialization fields.
FlightState(Flight flight)
          Creates a FlightState from a Flight object.
 
Method Summary
 java.lang.Object clone()
           
 Acid getAcid()
          Planned change of String ACID to type Acid.
 AcType getAcType()
          Returns the aircraft type from the flight plan, as an AcType.
 java.lang.String getAcTypeString()
          Returns the aircraft type from the flight plan, as a String.
 java.lang.String getAirLine()
           
 Runway getArrRunway()
           
 AirportRwyID getArrRwy()
          This will soon be deprecated.
 BeaconCode getBeaconCode()
           
 int getComplexity()
           
 Airport getDepAirport()
           
 AirportID getDepAirportID()
           
 Runway getDepRunway()
           
 AirportRwyID getDepRwy()
          This will soon be deprecated.
 Route getFiledRoute()
          Getting filed Route currently returns null because Route is not Recordable.
 java.lang.String getFiledRouteString()
           
 SimulationTime getFiledStartTime()
           
 Frequency getFrequency()
           
 java.lang.String getName()
          Returns ACID; if used as a storage key, old FlightStates will be replaced by the current ones.
 Position getPosition()
           
 SimulationTime getSimTime()
          Returns the SimulationTime that this state refers to.
 SimulationTime getStartTime()
           
 Ufp getUfp()
           
private  void readObject(java.io.ObjectInputStream in)
          Set AirportID (and Runway) if it is null and the flight does have a departure airport.
 void setFrequency(Frequency frequency)
           
 void setPosition(Position pos)
           
 java.lang.String toDraText()
          Prints DR&A text information to a String.
 java.lang.String toString()
          Prints the FlightState information to a String.
 
Methods inherited from class java.lang.Object
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

simTime

private final SimulationTime simTime
The SimulationTime at which this state information was created.


startTime

private SimulationTime startTime

filedStartTime

private SimulationTime filedStartTime

complexity

private int complexity

acid

private Acid acid

aircraftType

private AcType aircraftType

airLine

private java.lang.String airLine

arrRunway

private Runway arrRunway

depAirport

private Airport depAirport

depAirportID

private AirportID depAirportID

depRunway

private Runway depRunway

filedRouteString

private java.lang.String filedRouteString

frequency

private Frequency frequency

pos

private Position pos

ufp

private Ufp ufp
Constructor Detail

FlightState

public FlightState(Flight flight)
Creates a FlightState from a Flight object. This does not fill all the fields of FlightState: should get setFrequency() and setPosition() from Aircraft to complete the initialization.

Parameters:
flight - The Flight object to get the recordable state info from.

FlightState

public FlightState(Acid acid,
                   AcType acType,
                   SimulationTime startTime,
                   java.lang.String routeString,
                   Ufp ufp,
                   SimulationTime simTime,
                   Runway arrRwy,
                   Airport depAirport,
                   Runway depRwy)
Creates the FlightState with a standard set of initialization fields. If simTime is not set, the current simTime from Scenario will be used.

Parameters:
acid - The aircraft ID for the Flight: necessary.
acType - The aircraft type of the Flight: necessary.
startTime - The start time of the Flight: necessary.
routeString - The route of the Flight: necessary.
ufp - The UFP (Universal Flight Plan) of the Flight: necessary.
simTime - The simulation time of the Flight: if not set, the current simTime of the Scenario is used.
arrRwy - The arrival runway of the Flight: may be null.
depAirport - The departure airport of the Flight: may be null.
depRwy - The departure runway of the Flight: may be null.
Method Detail

readObject

private void readObject(java.io.ObjectInputStream in)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException
Set AirportID (and Runway) if it is null and the flight does have a departure airport.

Throws:
java.io.IOException
java.lang.ClassNotFoundException

setFrequency

public void setFrequency(Frequency frequency)

setPosition

public void setPosition(Position pos)

getName

public java.lang.String getName()
Returns ACID; if used as a storage key, old FlightStates will be replaced by the current ones.

Specified by:
getName in interface DraStorable
Specified by:
getName in interface ManagedObject
Specified by:
getName in class State
Returns:
Returns name unique to the class (or replacement of old object).

clone

public java.lang.Object clone()
Specified by:
clone in interface DraStorable
Overrides:
clone in class java.lang.Object
Returns:
Returns a clone of the aircraft state.

getSimTime

public SimulationTime getSimTime()
Returns the SimulationTime that this state refers to.

Specified by:
getSimTime in interface HasSimTime
Specified by:
getSimTime in class State
Returns:
Returns the simulation time.

getStartTime

public SimulationTime getStartTime()

getFiledStartTime

public SimulationTime getFiledStartTime()

getComplexity

public int getComplexity()

getAcid

public Acid getAcid()
Description copied from interface: HasAcid
Planned change of String ACID to type Acid.

Specified by:
getAcid in interface HasAcid
Returns:
Returns the aircraft ID.

getAcType

public AcType getAcType()
Returns the aircraft type from the flight plan, as an AcType.


getAcTypeString

public java.lang.String getAcTypeString()
Returns the aircraft type from the flight plan, as a String.


getAirLine

public java.lang.String getAirLine()

getArrRunway

public Runway getArrRunway()

getArrRwy

public AirportRwyID getArrRwy()
Description copied from interface: HasArrRwy
This will soon be deprecated. The airport ID is a unique three letter identifier. Runway name is a String containing two numbers and a possible L/R/C (left, right, center) indicator character.

Specified by:
getArrRwy in interface HasArrRwy
Returns:
Return format: airportID/runwayName (e.g. FFM/25L)

getDepAirport

public Airport getDepAirport()

getDepAirportID

public AirportID getDepAirportID()

getDepRunway

public Runway getDepRunway()

getDepRwy

public AirportRwyID getDepRwy()
Description copied from interface: HasDepRwy
This will soon be deprecated. The airport ID is a unique three letter identifier. Runway name is a String containing two numbers and a possible L/R/C (left, right, center) indicator character.

Specified by:
getDepRwy in interface HasDepRwy
Returns:
Return format: airportID/runwayName (e.g. FFM/25L)

getFiledRouteString

public java.lang.String getFiledRouteString()

getFiledRoute

public Route getFiledRoute()
Getting filed Route currently returns null because Route is not Recordable.


getFrequency

public Frequency getFrequency()

getPosition

public Position getPosition()
Specified by:
getPosition in interface HasPosition
Returns:
Returns the position of the object.

getUfp

public Ufp getUfp()

getBeaconCode

public BeaconCode getBeaconCode()
Specified by:
getBeaconCode in interface HasBeaconCode

toDraText

public java.lang.String toDraText()
Prints DR&A text information to a String.

Specified by:
toDraText in interface TextWritable
Returns:
Returns the DR&A information in string format.

toString

public java.lang.String toString()
Prints the FlightState information to a String.

Overrides:
toString in class java.lang.Object
Returns:
Returns the FlightState information in string format.