Class ProgramMetrics

java.lang.Object
org.deltava.beans.stats.ProgramMetrics
All Implemented Interfaces:
Serializable, Comparable<ProgramMetrics>, Cacheable

public class ProgramMetrics extends Object implements Cacheable, Comparable<ProgramMetrics>
A bean to store equipment program-specific statistics.
Since:
2.1
Version:
9.0
Author:
Luke
See Also:
  • Constructor Details

    • ProgramMetrics

      public ProgramMetrics(EquipmentType eq)
      Initializes the bean.
      Parameters:
      eq - the EquipmentType
  • Method Details

    • addPilots

      public void addPilots(Collection<Pilot> pilots)
      Adds pilots to this bean.
      Parameters:
      pilots - the Pilots in the equipment program
    • addPilot

      public void addPilot(Pilot p)
      Adds a pilot to this bean.
      Parameters:
      p - the Pilot to add
    • getSize

      public int getSize()
      Returns the number of Pilots in the program.
      Returns:
      the number of Pilots
    • getRankCounts

      public Map<Rank,Integer> getRankCounts()
    • getMaxRankCount

      public int getMaxRankCount()
    • getHireCounts

      public Map<Instant,Integer> getHireCounts()
    • getMaxHireCount

      public int getMaxHireCount()
    • getStatusCounts

      public Map<PilotStatus, Integer> getStatusCounts()
    • getMaxStatusCount

      public int getMaxStatusCount()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • cacheKey

      public Object cacheKey()
      Description copied from interface: Cacheable
      Returns the cache key for this object. Caches call this method when adding the object.
      Specified by:
      cacheKey in interface Cacheable
      Returns:
      the cache key for the object
    • compareTo

      public int compareTo(ProgramMetrics pm2)
      Compares two beans by comparing their equipment program beans.
      Specified by:
      compareTo in interface Comparable<ProgramMetrics>