Class SelectCall

java.lang.Object
org.deltava.beans.schedule.SelectCall
All Implemented Interfaces:
Serializable, Comparable<SelectCall>, ViewEntry

public class SelectCall extends Object implements Serializable, Comparable<SelectCall>, ViewEntry
A bean to store Aircraft SELCAL data and reservations.
Since:
1.0
Version:
11.0
Author:
Luke
See Also:
  • Constructor Details

    • SelectCall

      public SelectCall(String aircraft, String code)
      Creates a new SELCAL bean.
      Parameters:
      aircraft - the aircraft tail number
      code - the SELCAL code
      Throws:
      NullPointerException - if aircraft or code are null
      IllegalArgumentException - if code is not 4 or 5 characters
  • Method Details

    • getAircraftCode

      public String getAircraftCode()
      Returns the aircraft tail number.
      Returns:
      the tail number
      See Also:
    • getCode

      public String getCode()
      Returns the SELCAL code for the aircraft.
      Returns:
      the SELCAL code
      See Also:
    • getEquipmentType

      public String getEquipmentType()
      Returns the aircraft type.
      Returns:
      the equipment type
      See Also:
    • getReservedBy

      public int getReservedBy()
      Returns the Pilot who has reserved this aircraft's SELCAL code.
      Returns:
      the Pilot's database ID
      See Also:
    • getReservedOn

      public Instant getReservedOn()
      Returns the date this aircraft's SELCAL code was reserved.
      Returns:
      the date/time the SELCAL code was reserved.
      See Also:
    • free

      public void free()
      Marks this SELCAL record as available.
    • setAircraftCode

      public void setAircraftCode(String code)
      Updates the aircraft's tail number.
      Parameters:
      code - the registration code
      Throws:
      NullPointerException - if code is null
      See Also:
    • setCode

      public void setCode(String code)
      Updates the aircraft's SELCAL code. This method interposes
      Parameters:
      code - the SELCAL code
      Throws:
      NullPointerException - if code is null
      IllegalArgumentException - if code is not 4 or 5characters
      See Also:
    • setEquipmentType

      public void setEquipmentType(String eqType)
      Updates the aircraft equipment type.
      Parameters:
      eqType - the equipment type
      See Also:
    • setReservedBy

      public void setReservedBy(int id)
      Updates the Pilot reserving this aircraft's SELCAL code.
      Parameters:
      id - the Pilot's database ID
      Throws:
      IllegalArgumentException - if id is negative
      See Also:
    • setReservedOn

      public void setReservedOn(Instant dt)
      Updates the date this SELCAL code was reserved.
      Parameters:
      dt - the date/time the aircraft code was reserved
      See Also:
    • toString

      public String toString()
      Displays the SELCAL code.
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(SelectCall sc2)
      Compares two beans by comparing the SELCAL codes.
      Specified by:
      compareTo in interface Comparable<SelectCall>
    • getRowClassName

      public String getRowClassName()
      Returns the CSS row class name if in a table view.
      Specified by:
      getRowClassName in interface ViewEntry
      Returns:
      the CSS class name