faa.tg.nas.sector
Class Sector

java.lang.Object
  extended by faa.tg.nas.sector.Sector
All Implemented Interfaces:
DelimWritable, DraStorable, TextWritable, HasName, HasSector, Filterable, Recordable, ManagedObject, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
GeoSector

public class Sector
extends java.lang.Object
implements HasName, HasSector, TextWritable, DelimWritable, DraStorable

 Contains information on sectors (controller areas of responsibility,
 denoted by frequency).
 
See the source: Sector.java

Version:
$Id: Sector.java,v 3.11 2008/08/25 20:30:58 lykensj Exp $
Author:
Michael E Ross
See Also:
GeoSector, Serialized Form

Field Summary
static java.lang.String CVS_VERSION_ID
          The CVS Version ID
static java.text.DecimalFormat DEC000
          Number format for flight level output: "000".
static java.lang.String ENROUTE_TERMINAL
          Sector type Enroute_Terminal
private  java.util.List<Frequency> freqList
          OBSOLETE: delete when no longer need recordings made before 5/20/2008.
protected  java.util.Vector<Frequency> frequencies
          The frequencies belonging to this sector: the first frequency in the list is the primary frequency.
protected static MethodMap methodMap
           
static java.lang.String OCEANIC
          Sector type Oceanic
protected  java.util.ArrayList<SectorAction> sectorActions
           
protected  SectorID sectorID
          SectorID contains a two digit number that identifies the sector.
protected  SectorName sectorName
          SectorName contains a name used to identify the sector: it can be more descriptive than the sectorID if desired.
protected  java.lang.String sectorType
          Airspace type of sector.
(package private) static long serialVersionUID
           
 
Constructor Summary
Sector(SectorID sectorID)
          Constructor for Sector without Frequency.
Sector(SectorID sectorID, SectorName sectorName)
          Constructor for Sector without Frequency.
Sector(SectorID sectorID, SectorName sectorName, Frequency primaryFreq)
          Constructor for Sector: specifies the sector ID, the sector name, and the primary sector frequency.
 
Method Summary
 void addAction(SectorAction sectorAction)
          Adds an action to the actionList for this sector.
 void addFrequency(Frequency frequency)
          Add a (Voice) Frequency to the the Sector
 java.lang.Object clone()
          Clones the sector.
 boolean contains(Frequency frequency)
          Returns true if this sector contains the given Frequency Needs to check complete list
 boolean equals(Sector other)
          Returns whether this Sector is the same as another sector (checks if SectorNames are equal).
 void executeActions(Aircraft ac, SimEventMgr eventMgr)
           
 java.util.Vector<Frequency> getFrequencies()
          Returns all frequencies this sector possess.
 MethodMap getMethodMap()
          Returns Sector field/values as a MethodMap (used by DelimWriter).
 java.lang.String getName()
          Returns the sector ID as a name String (unique identifier).
 Frequency getPrimaryFrequency()
          Returns the first frequency element in the sector's frequencyList.
 Sector getSector()
          Returns this Object to meet the HasSector interface requirements.
 SectorID getSectorID()
          Returns the sector identifier as a SectorID.
 SectorName getSectorName()
          Returns the Sector name as a SectorName.
 java.lang.String getSectorType()
          Returns the String sector type.
protected static MethodMap makeMethodMap()
          Returns the Sector information in DelimWritable format.
 int numberOfFreqs()
          Returns the number of frequencies this sector has in its freqList.
private  void readObject(java.io.ObjectInputStream in)
          Set sector ID and name if not defined.
 void setSectorType(java.lang.String sectorType)
          Set sector type.
 java.lang.String toDraText()
          Returns the Sector information as a DR&A text String.
 java.lang.String toString()
          Returns the sector description as 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

DEC000

public static final java.text.DecimalFormat DEC000
Number format for flight level output: "000".


OCEANIC

public static final java.lang.String OCEANIC
Sector type Oceanic

See Also:
Constant Field Values

ENROUTE_TERMINAL

public static final java.lang.String ENROUTE_TERMINAL
Sector type Enroute_Terminal

See Also:
Constant Field Values

sectorName

protected SectorName sectorName
SectorName contains a name used to identify the sector: it can be more descriptive than the sectorID if desired.


sectorID

protected SectorID sectorID
SectorID contains a two digit number that identifies the sector.


frequencies

protected java.util.Vector<Frequency> frequencies
The frequencies belonging to this sector: the first frequency in the list is the primary frequency.


freqList

private final java.util.List<Frequency> freqList
OBSOLETE: delete when no longer need recordings made before 5/20/2008. The frequencies belonging to this sector.


sectorActions

protected java.util.ArrayList<SectorAction> sectorActions

sectorType

protected java.lang.String sectorType
Airspace type of sector.


methodMap

protected static MethodMap methodMap
Constructor Detail

Sector

public Sector(SectorID sectorID,
              SectorName sectorName,
              Frequency primaryFreq)
Constructor for Sector: specifies the sector ID, the sector name, and the primary sector frequency.

Parameters:
sectorID - Object with two-digit number that identifies the sector.
sectorName - Descriptive name object that identifies the sector.
primaryFreq - Primary frequency associated with the sector.

Sector

public Sector(SectorID sectorID)
Constructor for Sector without Frequency.

Parameters:
sectorID - Two letter identifier of sector.

Sector

public Sector(SectorID sectorID,
              SectorName sectorName)
Constructor for Sector without Frequency.

Parameters:
sectorID - Two letter identifier of sector.
sectorName - Descriptive name object that identifies the sector.
Method Detail

readObject

private void readObject(java.io.ObjectInputStream in)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException
Set sector ID and name if not defined.

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

getSectorID

public SectorID getSectorID()
Returns the sector identifier as a SectorID.


getSectorName

public SectorName getSectorName()
Returns the Sector name as a SectorName.


getSector

public Sector getSector()
Returns this Object to meet the HasSector interface requirements.

Specified by:
getSector in interface HasSector
Returns:
Returns the sector.

getSectorType

public java.lang.String getSectorType()
Returns the String sector type.


setSectorType

public void setSectorType(java.lang.String sectorType)
Set sector type.


numberOfFreqs

public int numberOfFreqs()
Returns the number of frequencies this sector has in its freqList.


addFrequency

public void addFrequency(Frequency frequency)
Add a (Voice) Frequency to the the Sector


getPrimaryFrequency

public Frequency getPrimaryFrequency()
Returns the first frequency element in the sector's frequencyList.


getFrequencies

public java.util.Vector<Frequency> getFrequencies()
Returns all frequencies this sector possess.


getName

public java.lang.String getName()
Returns the sector ID as a name String (unique identifier).

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

clone

public java.lang.Object clone()
Clones the sector.

Specified by:
clone in interface DraStorable
Overrides:
clone in class java.lang.Object
Returns:
Returns a copy of this Sector.

equals

public boolean equals(Sector other)
Returns whether this Sector is the same as another sector (checks if SectorNames are equal).

Parameters:
other - The other Sector to compare to.
Returns:
Return whether this Sector is the same as the other Sector.

contains

public boolean contains(Frequency frequency)
Returns true if this sector contains the given Frequency Needs to check complete list


toString

public java.lang.String toString()
Returns the sector description as a String.

Overrides:
toString in class java.lang.Object

toDraText

public java.lang.String toDraText()
Returns the Sector information as a DR&A text String.

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

addAction

public void addAction(SectorAction sectorAction)
Adds an action to the actionList for this sector.


executeActions

public void executeActions(Aircraft ac,
                           SimEventMgr eventMgr)

getMethodMap

public MethodMap getMethodMap()
Returns Sector field/values as a MethodMap (used by DelimWriter).

Specified by:
getMethodMap in interface DelimWritable
Returns:
Returns the map of MethodSpec objects containing all fields that are to be printed for a Class in delimited-type reports.

makeMethodMap

protected static MethodMap makeMethodMap()
Returns the Sector information in DelimWritable format.