Class TourFlightHelper

java.lang.Object
org.deltava.beans.flight.TourFlightHelper

public class TourFlightHelper extends Object
A helper class to calculate Flight Tour eligibility.
Since:
10.0
Version:
11.2
Author:
Luke
  • Constructor Details

    • TourFlightHelper

      public TourFlightHelper(FlightData fr, boolean allowSubmitted)
      Initializes the Helper.
      Parameters:
      fr - the FlightData to calculate eligibility for
      allowSubmitted - TRUE to allow submitted previous flights to count for eligibility, otherwise FALSE
  • Method Details

    • getMessages

      public Collection<String> getMessages()
      Returns the eligibility messages.
      Returns:
      a Collection of messages
    • hasMessage

      public boolean hasMessage()
      Returns if there is an eligibility message.
      Returns:
      TRUE if there is at least one message, otherwise FALSE
    • addFlights

      public void addFlights(Collection<FlightReport> flights)
      Adds previous flights to the Helper.
      Parameters:
      flights - a Collection of FlightReport beans
    • isComplete

      public boolean isComplete(Tour t)
      Returns whether a given Flight Tour has been completed.
      Parameters:
      t - the Tour
      Returns:
      TRUE if completed, otherwise FALSE
    • isLeg

      public int isLeg(Tour t)
      Determines whether the Flight is a valid Flight Tour leg.
      Parameters:
      t - the Tour to check
      Returns:
      the leg index within the Tour, or zero if not found