Class RolloverYearlyTotal
java.lang.Object
org.deltava.beans.DatabaseBean
org.deltava.beans.econ.YearlyTotal
org.deltava.beans.econ.RolloverYearlyTotal
- All Implemented Interfaces:
Serializable, Cloneable, Comparable<Object>, EliteTotals, IDBean, Cacheable
A bean to store yearly totals with rollover amounts.
- Since:
- 11.1
- Version:
- 12.4
- Author:
- Luke
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRolloverYearlyTotal(int year, int pilotID) Creates the beanConverts a YearlyTotal bean to one supporting rollover. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRollover(int legs, int distance, int pts) Adds rollover totals.Projects year to date totals over a full year.intReturns the distance flown.intgetLegs()Returns the number of flight legs.intReturns the number of Elite points.Returns rollover totals for the year.booleanReturns whether this year's totals include rollovers from the previous year.voidmerge(YearlyTotal yt) Merges a yearly total into this bean.voidreset(int year) Resets the totals.Methods inherited from class YearlyTotal
add, addLegs, cacheKey, delta, getYear, matches, matches, toString, wouldMatchModifier and TypeMethodDescriptionvoidadd(FlightEliteScore sc) Adds a Flight's totals.voidaddLegs(int legs, int distance, int pts) Adds aggregated totals.cacheKey()Returns the cache key for this object.delta(EliteLevel el) Returns the prerequisites required to achieve a particular Elite level.intgetYear()Returns the program year.matches(Collection<EliteLevel> lvls) Returns the highest level whose requirements match this total.booleanmatches(EliteTotals el) Returns whether these totals match the requirements for a given Elite level.toString()wouldMatch(EliteTotals el, FlightEliteScore sc) Returns whether a specific flight leg would trigger a given Elite Level.Methods inherited from class DatabaseBean
compareTo, equals, getHexID, getID, hashCode, setID, validateID, validateIDModifier and TypeMethodDescriptionintbooleangetHexID()Returns the hexadecimal database ID of this object.intgetID()Returns the database ID of this object.inthashCode()voidsetID(int id) Update the database row ID of this bean.static voidvalidateID(int oldID, int newID) Validates a database ID.static voidvalidateID(int oldID, int newID, boolean allowZero) Validates a database ID.Methods inherited from interface EliteTotals
hasDistance, hasLegs, hasPoints, isZeroModifier and TypeMethodDescriptiondefault booleanReturns if the distance flown is greater than zero.default booleanhasLegs()Returns if the number of flight lges is greater than zero.default booleanReturns if the number of Elite points is greater than zero.default booleanisZero()Returns if legs, distance and points are all zero.
-
Constructor Details
-
RolloverYearlyTotal
public RolloverYearlyTotal(int year, int pilotID) Creates the bean- Parameters:
year- the program yearpilotID- the Pilot's Database ID
-
RolloverYearlyTotal
Converts a YearlyTotal bean to one supporting rollover.- Parameters:
yt- a YearlyTotal bean
-
-
Method Details
-
getLegs
public int getLegs()Description copied from interface:EliteTotalsReturns the number of flight legs.- Specified by:
getLegsin interfaceEliteTotals- Overrides:
getLegsin classYearlyTotal- Returns:
- the number of legs
-
getDistance
public int getDistance()Description copied from interface:EliteTotalsReturns the distance flown.- Specified by:
getDistancein interfaceEliteTotals- Overrides:
getDistancein classYearlyTotal- Returns:
- the distance in miles
-
getPoints
public int getPoints()Description copied from interface:EliteTotalsReturns the number of Elite points.- Specified by:
getPointsin interfaceEliteTotals- Overrides:
getPointsin classYearlyTotal- Returns:
- the number of points
-
hasRollover
public boolean hasRollover()Description copied from class:YearlyTotalReturns whether this year's totals include rollovers from the previous year.- Overrides:
hasRolloverin classYearlyTotal- Returns:
- FALSE
-
getRollover
-
addRollover
public void addRollover(int legs, int distance, int pts) Adds rollover totals.- Parameters:
legs- the number of legsdistance- the distancepts- the points
-
adjust
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:
adjustin classYearlyTotal- Parameters:
ld- the date to project from- Returns:
- a YearlyTotal bean
-
merge
Merges a yearly total into this bean.- Parameters:
yt- a YearlyTotal bean
-
reset
public void reset(int year) Description copied from class:YearlyTotalResets the totals.- Overrides:
resetin classYearlyTotal- Parameters:
year- the new program year
-