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 -
Constructor Summary
ConstructorsConstructorDescriptionEquipmentType
(String eqName) Create a new EquipmentType object for a given aircraft type -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an Airline to the list of applications whose Pilots can get ratings in this equipment program.void
Adds an examination required for promotion into a particular rank.void
addPrimaryRating
(String rating) Adds a primary rating to the list and removes it from the secondary rating list.void
Add an available rank to this equipment type.void
Adds a number of ranks to this equipment type.void
addSecondaryRating
(String rating) Adds a secondary rating to the list and removes it from the primary rating list.cacheKey()
Returns the cache key for this object.int
compareTo
(EquipmentType et2) 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
getCPID()
Return the database row ID of this equipment program's chief pilot.Returns all exams associated with this equipment program.getExamNames
(Rank rank) Return the name of the examination required for promotion into a rankboolean
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.getName()
Returns the name of the equipment type program.boolean
Returns whether this equipment program accepts new hires.getOwner()
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.getRanks()
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
getSize()
Returns the number of active pilots in the Equipment Program.int
getStage()
Returns the equipment type stage.int
hashCode()
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
setAirlines
(Collection<AirlineInformation> airlines) 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
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.void
setRanks
(Collection<String> ranks) Updates the available ranks for this Equipment Program.void
setRatings
(Collection<String> pr, Collection<String> sr) 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.toString()
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
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
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
Return the list of available ranks in this program.- Returns:
- An unsorted list of available ranks
- See Also:
-
getPrimaryRatings
Return the list of aircraft types that are considered "primary ratings".- Returns:
- a sorted list of aircraft types
- See Also:
-
getSecondaryRatings
Return the list of aircraft types that are considered "secondary ratings".- Returns:
- a sorted list of aircraft types
- See Also:
-
getRatings
Returns all primary and secondary ratings.- Returns:
- a sorted list of aircraft types
- See Also:
-
getExamNames
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
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
Returns the Airline that owns this equipment program profile.- Returns:
- an AirlineInformation bean
- See Also:
-
getAirlines
Returns the Airlines whose pilots can get ratings via this equipment program.- Returns:
- a Collection of AirlineInformation beans
- See Also:
-
setName
Updates the equipment program name.- Parameters:
name
- the name- Throws:
NullPointerException
- if name is null- See Also:
-
addRank
Add an available rank to this equipment type.- Parameters:
rank
- The rank- See Also:
-
addRanks
Adds a number of ranks to this equipment type.- Parameters:
ranks
- A token-delimited string of ranksdelim
- A token delimieter for the ranks parameter- Throws:
NullPointerException
- if the list string is null- See Also:
-
setRanks
Updates the available ranks for this Equipment Program.- Parameters:
ranks
- a Collection of rank names
-
addPrimaryRating
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
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
Loads primary/secondary ratings.- Parameters:
pr
- a Collection of primary ratingssr
- 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
-
setExamNames
Set the examinations required for promotion into a particular rank.- Parameters:
rank
- The rank to be promoted intoexamNames
- The name of the examinations- See Also:
-
setOwner
Updates the Airline that owns this equipment program.- Parameters:
ai
- an AirlineInformation bean- See Also:
-
addAirline
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
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
Compares programs by comparing stage values, then the name.- Specified by:
compareTo
in interfaceComparable<EquipmentType>
-
equals
-
hashCode
-
toString
-
getComboAlias
Description copied from interface:ComboAlias
Returns the alias to use in the HTML <OPTION> element.- Specified by:
getComboAlias
in interfaceComboAlias
- Returns:
- The alias for this entry
-
getComboName
Description copied from interface:ComboAlias
Returns the visible name to use in the HTML <OPTION> element.- Specified by:
getComboName
in interfaceComboAlias
- Returns:
- The visible name for this entry
-
cacheKey
-
getRowClassName
Description copied from interface:ViewEntry
Returns the CSS class for this object if rendered in a view table.- Specified by:
getRowClassName
in interfaceViewEntry
- Returns:
- the CSS class name, or NULL if none
-
getAuditID
Description copied from interface:Auditable
Returns the object ID for this auditable object.- Specified by:
getAuditID
in interfaceAuditable
- Returns:
- the ID
-