Class EquipmentType

java.lang.Object
org.deltava.beans.EquipmentType
All Implemented Interfaces:
Serializable, Cloneable, Comparable<EquipmentType>, Auditable, ComboAlias, ViewEntry, Cacheable

public class EquipmentType extends Object implements Cacheable, Auditable, Comparable<EquipmentType>, ComboAlias, ViewEntry
A class for storing equipment program information.
Since:
1.0
Version:
8.0
Author:
Luke
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a new EquipmentType object for a given aircraft type
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds an Airline to the list of applications whose Pilots can get ratings in this equipment program.
    void
    addExam(Rank rank, String examName)
    Adds an examination required for promotion into a particular rank.
    void
    Adds a primary rating to the list and removes it from the secondary rating list.
    void
    addRank(Rank rank)
    Add an available rank to this equipment type.
    void
    addRanks(String ranks, String delim)
    Adds a number of ranks to this equipment type.
    void
    Adds a secondary rating to the list and removes it from the primary rating list.
    Returns the cache key for this object.
    int
    Compares programs by comparing stage values, then the name.
    boolean
    Determine equality by comparing the program names.
    boolean
    Returns whether flights counting towards promotion must be logged using ACARS.
    boolean
    Returns whether this equipment program is active.
    Returns the Airlines whose pilots can get ratings via this equipment program.
    Returns the object ID for this auditable object.
    Returns the alias to use in the HTML <OPTION> element.
    Returns the visible name to use in the HTML <OPTION> element.
    int
    Return the database row ID of this equipment program's chief pilot.
    Returns all exams associated with this equipment program.
    Return the name of the examination required for promotion into a rank
    boolean
    Returns whether this is default equipment program for Flight Academy and Applicant hire purposes.
    int
    Returns the maximum amount of accelerated time for a flight under the switch length in order to count for promotion to Captain.
    int
    Returns the minimum amount of 1X time for a flight over the switch length in order to count for promotion to Captain.
    Returns the name of the equipment type program.
    boolean
    Returns whether this equipment program accepts new hires.
    Returns the Airline that owns this equipment program profile.
    Return the list of aircraft types that are considered "primary ratings".
    int
    Return the number of hours required for promotion to Captain.
    int
    Return the number of flight legs required for promotion to Captain.
    int
    Returns the minimum flight leg distance requires for promotion to Captain.
    int
    Returns the flight distance where accelerated time is limted, to where a minimum amount of 1X time is required.
    Return the list of available ranks in this program.
    Returns all primary and secondary ratings.
    Returns the CSS class for this object if rendered in a view table.
    Return the list of aircraft types that are considered "secondary ratings".
    int
    Returns the number of active pilots in the Equipment Program.
    int
    Returns the equipment type stage.
    int
    Returns the name's hashcode.
    void
    setACARSPromotionLegs(boolean useACARS)
    Updates whether flights counting towards promotion must be logged using ACARS.
    void
    setActive(boolean active)
    Marks this equipment program as active.
    void
    Updates the list of applications whose Pilots can get ratings in this equipment program.
    void
    setCPID(int id)
    Update the database row ID of this program's Chief Pilot.
    void
    setExamNames(Rank rank, Collection<String> examNames)
    Set the examinations required for promotion into a particular rank.
    void
    setIsDefault(boolean isDefault)
    Marks this equipment program as the default program for new hires and the Flight Academy.
    void
    setMaximumAccelTime(int maxTime)
    Sets the maximum amount of accelerated time for a flight under the switch length in order to count for promotion to Captain.
    void
    setMinimum1XTime(int minTime)
    Sets the minimum amount of 1X time for a flight over the switch length in order to count for promotion to Captain.
    void
    Updates the equipment program name.
    void
    setNewHires(boolean newHires)
    Updates whether this equipment program accepts new hires.
    void
    Updates the Airline that owns this equipment program.
    void
    setPromotionHours(int hours)
    Set the number of hours required for promotion to Cpatain.
    void
    setPromotionLegs(int legs)
    Set the number of legs required for promotion to Captain.
    void
    setPromotionMinLength(int distance)
    Sets the minimum length of a leg for promotion to Captain.
    void
    Sets the distance at which promotion eligibility switches from a maximum amount of accelerated time to a minimum amount of 1X time.
    void
    Updates the available ranks for this Equipment Program.
    void
    Loads primary/secondary ratings.
    void
    setSize(int size)
    Sets the number of active Pilots in this equipment program.
    void
    setStage(int stage)
    Sets the stage for this equipment program.
    When converting to a string, just return the name.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.deltava.beans.Auditable

    getAuditType, isCrossApp
  • Constructor Details

    • EquipmentType

      public EquipmentType(String eqName)
      Create a new EquipmentType object for a given aircraft type
      Parameters:
      eqName - The name of the equipment type program
      Throws:
      NullPointerException - if the name is null
      See Also:
  • Method Details

    • getName

      public String getName()
      Returns the name of the equipment type program.
      Returns:
      The equipment type name
      See Also:
    • getCPID

      public int getCPID()
      Return the database row ID of this equipment program's chief pilot. This typically will only be called by a DAO
      Returns:
      The primary key of the entry in the PILOTS table in the database that corresponds to this Equipment Type's chief pilot.
      See Also:
    • getStage

      public int getStage()
      Returns the equipment type stage.
      Returns:
      The stage number of the equipment type
      See Also:
    • getSize

      public int getSize()
      Returns the number of active pilots in the Equipment Program.
      Returns:
      the number of active pilots.
      See Also:
    • getRanks

      public Collection<Rank> getRanks()
      Return the list of available ranks in this program.
      Returns:
      An unsorted list of available ranks
      See Also:
    • getPrimaryRatings

      public Collection<String> getPrimaryRatings()
      Return the list of aircraft types that are considered "primary ratings".
      Returns:
      a sorted list of aircraft types
      See Also:
    • getSecondaryRatings

      public Collection<String> getSecondaryRatings()
      Return the list of aircraft types that are considered "secondary ratings".
      Returns:
      a sorted list of aircraft types
      See Also:
    • getRatings

      public Collection<String> getRatings()
      Returns all primary and secondary ratings.
      Returns:
      a sorted list of aircraft types
      See Also:
    • getExamNames

      public Collection<String> getExamNames(Rank rank)
      Return the name of the examination required for promotion into a rank
      Parameters:
      rank - The rank to be promoted into. Use Ranks.ENTRY for an entrance exam.
      Returns:
      The names of the examinations
      See Also:
    • getExamNames

      public Collection<String> getExamNames()
      Returns all exams associated with this equipment program.
      Returns:
      a Collection of exam names
      See Also:
    • getPromotionHours

      public int getPromotionHours()
      Return the number of hours required for promotion to Captain.
      Returns:
      The number of hours required for a promotion out of the specified rank, returns 0 if not set
      See Also:
    • getPromotionLegs

      public int getPromotionLegs()
      Return the number of flight legs required for promotion to Captain.
      Returns:
      The number of legs required for a promotion out of the specified rank, returns 0 if not set
      See Also:
    • getPromotionMinLength

      public int getPromotionMinLength()
      Returns the minimum flight leg distance requires for promotion to Captain.
      Returns:
      the minimum leg distance in miles
      See Also:
    • getPromotionSwitchLength

      public int getPromotionSwitchLength()
      Returns the flight distance where accelerated time is limted, to where a minimum amount of 1X time is required.
      Returns:
      the flight distance
      See Also:
    • getMinimum1XTime

      public int getMinimum1XTime()
      Returns the minimum amount of 1X time for a flight over the switch length in order to count for promotion to Captain.
      Returns:
      the minimum amount of time in seconds
      See Also:
    • getMaximumAccelTime

      public int getMaximumAccelTime()
      Returns the maximum amount of accelerated time for a flight under the switch length in order to count for promotion to Captain.
      Returns:
      the maximum amount of time in seconds
      See Also:
    • getACARSPromotionLegs

      public boolean getACARSPromotionLegs()
      Returns whether flights counting towards promotion must be logged using ACARS.
      Returns:
      TRUE if promotion legs must be logged using ACARS, otherwise FALSE
      See Also:
    • getActive

      public boolean getActive()
      Returns whether this equipment program is active.
      Returns:
      TRUE if the program is active, otherwise FALSE
      See Also:
    • getIsDefault

      public boolean getIsDefault()
      Returns whether this is default equipment program for Flight Academy and Applicant hire purposes.
      Returns:
      TRUE if default program, otherwise FALSE
      See Also:
    • getNewHires

      public boolean getNewHires()
      Returns whether this equipment program accepts new hires.
      Returns:
      TRUE if new hires are accepted, otherwise FALSE
    • getOwner

      public AirlineInformation getOwner()
      Returns the Airline that owns this equipment program profile.
      Returns:
      an AirlineInformation bean
      See Also:
    • getAirlines

      public Collection<AirlineInformation> getAirlines()
      Returns the Airlines whose pilots can get ratings via this equipment program.
      Returns:
      a Collection of AirlineInformation beans
      See Also:
    • setName

      public void setName(String name)
      Updates the equipment program name.
      Parameters:
      name - the name
      Throws:
      NullPointerException - if name is null
      See Also:
    • addRank

      public void addRank(Rank rank)
      Add an available rank to this equipment type.
      Parameters:
      rank - The rank
      See Also:
    • addRanks

      public void addRanks(String ranks, String delim)
      Adds a number of ranks to this equipment type.
      Parameters:
      ranks - A token-delimited string of ranks
      delim - A token delimieter for the ranks parameter
      Throws:
      NullPointerException - if the list string is null
      See Also:
    • setRanks

      public void setRanks(Collection<String> ranks)
      Updates the available ranks for this Equipment Program.
      Parameters:
      ranks - a Collection of rank names
    • addPrimaryRating

      public void addPrimaryRating(String rating)
      Adds a primary rating to the list and removes it from the secondary rating list.
      Parameters:
      rating - The aircraft type to add
      Throws:
      NullPointerException - if the rating is null
      See Also:
    • addSecondaryRating

      public void addSecondaryRating(String rating)
      Adds a secondary rating to the list and removes it from the primary rating list.
      Parameters:
      rating - The aircraft type to add
      Throws:
      NullPointerException - if the rating is null
      See Also:
    • setActive

      public void setActive(boolean active)
      Marks this equipment program as active.
      Parameters:
      active - TRUE if the program is active, otherwise FALSE
      See Also:
    • setIsDefault

      public void setIsDefault(boolean isDefault)
      Marks this equipment program as the default program for new hires and the Flight Academy.
      Parameters:
      isDefault - TRUE if the default program, otherwise FALSE
      See Also:
    • setACARSPromotionLegs

      public void setACARSPromotionLegs(boolean useACARS)
      Updates whether flights counting towards promotion must be logged using ACARS.
      Parameters:
      useACARS - TRUE if flights must be logged using ACARS, otherwise FALSE
      See Also:
    • setNewHires

      public void setNewHires(boolean newHires)
      Updates whether this equipment program accepts new hires.
      Parameters:
      newHires - TRUE if new hires can be placed directly into this program, otherwise FALSE
      See Also:
    • setRatings

      public void setRatings(Collection<String> pr, Collection<String> sr)
      Loads primary/secondary ratings.
      Parameters:
      pr - a Collection of primary ratings
      sr - a Collection of secondary ratings
    • setCPID

      public void setCPID(int id)
      Update the database row ID of this program's Chief Pilot. This typically will only be called by a DAO
      Parameters:
      id - The primary key of the entry in the PILOTS table in the database that corresponds to this Equipment Program's chief pilot.
      Throws:
      IllegalArgumentException - if the database ID is negative
      See Also:
    • addExam

      public void addExam(Rank rank, String examName)
      Adds an examination required for promotion into a particular rank.
      Parameters:
      rank - The rank to be promoted into
      examName - The name of the examination
      See Also:
    • setExamNames

      public void setExamNames(Rank rank, Collection<String> examNames)
      Set the examinations required for promotion into a particular rank.
      Parameters:
      rank - The rank to be promoted into
      examNames - The name of the examinations
      See Also:
    • setOwner

      public void setOwner(AirlineInformation ai)
      Updates the Airline that owns this equipment program.
      Parameters:
      ai - an AirlineInformation bean
      See Also:
    • addAirline

      public void addAirline(AirlineInformation ai)
      Adds an Airline to the list of applications whose Pilots can get ratings in this equipment program.
      Parameters:
      ai - an AirlineInformation bean
      See Also:
    • setAirlines

      public void setAirlines(Collection<AirlineInformation> airlines)
      Updates the list of applications whose Pilots can get ratings in this equipment program.
      Parameters:
      airlines - a Collection of AirlineInformation beans
      See Also:
    • setStage

      public void setStage(int stage)
      Sets the stage for this equipment program.
      Parameters:
      stage - The stage number for this program
      See Also:
    • setSize

      public void setSize(int size)
      Sets the number of active Pilots in this equipment program.
      Parameters:
      size - the number of pilots
      See Also:
    • setPromotionHours

      public void setPromotionHours(int hours)
      Set the number of hours required for promotion to Cpatain.
      Parameters:
      hours - The number of hours required for promotion
      See Also:
    • setPromotionLegs

      public void setPromotionLegs(int legs)
      Set the number of legs required for promotion to Captain.
      Parameters:
      legs - The number of legs required for promotion
      See Also:
    • setPromotionMinLength

      public void setPromotionMinLength(int distance)
      Sets the minimum length of a leg for promotion to Captain.
      Parameters:
      distance - the distance in miles
      See Also:
    • setPromotionSwitchLength

      public void setPromotionSwitchLength(int distance)
      Sets the distance at which promotion eligibility switches from a maximum amount of accelerated time to a minimum amount of 1X time.
      Parameters:
      distance - the leg switch distance
      See Also:
    • setMinimum1XTime

      public void setMinimum1XTime(int minTime)
      Sets the minimum amount of 1X time for a flight over the switch length in order to count for promotion to Captain.
      Parameters:
      minTime - the minimum amount of time in seconds
      See Also:
    • setMaximumAccelTime

      public void setMaximumAccelTime(int maxTime)
      Sets the maximum amount of accelerated time for a flight under the switch length in order to count for promotion to Captain.
      Parameters:
      maxTime - the maximum amount of time in seconds
      See Also:
    • compareTo

      public int compareTo(EquipmentType et2)
      Compares programs by comparing stage values, then the name.
      Specified by:
      compareTo in interface Comparable<EquipmentType>
    • equals

      public boolean equals(Object o2)
      Determine equality by comparing the program names.
      Overrides:
      equals in class Object
      See Also:
    • hashCode

      public int hashCode()
      Returns the name's hashcode.
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      When converting to a string, just return the name.
      Overrides:
      toString in class Object
      See Also:
    • getComboAlias

      public String getComboAlias()
      Description copied from interface: ComboAlias
      Returns the alias to use in the HTML <OPTION> element.
      Specified by:
      getComboAlias in interface ComboAlias
      Returns:
      The alias for this entry
    • getComboName

      public String getComboName()
      Description copied from interface: ComboAlias
      Returns the visible name to use in the HTML <OPTION> element.
      Specified by:
      getComboName in interface ComboAlias
      Returns:
      The visible name for this entry
    • cacheKey

      public Object cacheKey()
      Description copied from interface: Cacheable
      Returns the cache key for this object. Caches call this method when adding the object.
      Specified by:
      cacheKey in interface Cacheable
      Returns:
      the cache key for the object
    • getRowClassName

      public String getRowClassName()
      Description copied from interface: ViewEntry
      Returns the CSS class for this object if rendered in a view table.
      Specified by:
      getRowClassName in interface ViewEntry
      Returns:
      the CSS class name, or NULL if none
    • getAuditID

      public String getAuditID()
      Description copied from interface: Auditable
      Returns the object ID for this auditable object.
      Specified by:
      getAuditID in interface Auditable
      Returns:
      the ID