Class RolloverYearlyTotal

All Implemented Interfaces:
Serializable, Cloneable, Comparable<Object>, EliteTotals, IDBean, Cacheable

public class RolloverYearlyTotal extends YearlyTotal
A bean to store yearly totals with rollover amounts.
Since:
11.1
Version:
11.2
Author:
Luke
See Also:
  • Constructor Details

    • RolloverYearlyTotal

      public RolloverYearlyTotal(int year, int pilotID)
      Creates the bean
      Parameters:
      year - the program year
      pilotID - the Pilot's Database ID
    • RolloverYearlyTotal

      public RolloverYearlyTotal(YearlyTotal yt)
      Converts a YearlyTotal bean to one supporting rollover.
      Parameters:
      yt - a YearlyTotal bean
  • Method Details

    • getLegs

      public int getLegs()
      Description copied from interface: EliteTotals
      Returns the number of flight legs.
      Specified by:
      getLegs in interface EliteTotals
      Overrides:
      getLegs in class YearlyTotal
      Returns:
      the number of legs
    • getDistance

      public int getDistance()
      Description copied from interface: EliteTotals
      Returns the distance flown.
      Specified by:
      getDistance in interface EliteTotals
      Overrides:
      getDistance in class YearlyTotal
      Returns:
      the distance in miles
    • getPoints

      public int getPoints()
      Description copied from interface: EliteTotals
      Returns the number of Elite points.
      Specified by:
      getPoints in interface EliteTotals
      Overrides:
      getPoints in class YearlyTotal
      Returns:
      the number of points
    • getRollover

      public YearlyTotal getRollover()
      Returns rollover totals for the year.
      Returns:
      a YearlyTotal bean
    • addRollover

      public void addRollover(int legs, int distance, int pts)
      Adds rollover totals.
      Parameters:
      legs - the number of legs
      distance - the distance
      pts - the points
    • adjust

      public YearlyTotal adjust(LocalDate ld)
      Projects year to date totals over a full year. This will have no effect on totals for a prior year. This calls the superclass to extrapolate earned totals across the year, and then adds the previous year's rollover totals to reflect the fact that they are one-time totals, not to be extrapolated across the entire year.
      Overrides:
      adjust in class YearlyTotal
      Parameters:
      ld - the date to project from
      Returns:
      a YearlyTotal bean
    • merge

      public void merge(YearlyTotal yt)
      Merges a yearly total into this bean.
      Parameters:
      yt - a YearlyTotal bean
    • reset

      public void reset(int year)
      Description copied from class: YearlyTotal
      Resets the totals.
      Overrides:
      reset in class YearlyTotal
      Parameters:
      year - the new program year