Class LegHoursStatsEntry<K extends Comparable<K>>

java.lang.Object
org.deltava.beans.stats.LegHoursStatsEntry<K>
Type Parameters:
K - The sort key
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
LegHoursDateStatsEntry, OnlineStatsEntry

abstract class LegHoursStatsEntry<K extends Comparable<K>> extends Object implements Serializable
A bean to store ordered statistics entries that contain a key value plus hours/legs/distance.
Since:
8.3
Version:
10.3
Author:
Luke
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the flight distance for a particular key.
    double
    getHours(K key)
    Returns the number of flight hours for a particular key.
    Returns tthe available keys.
    int
    getLegs(K key)
    Returns the number of flight legs for a particular key.
    protected K
    Returns the maximum key value in this bean.
    protected void
    inc(K key, int distance, double hours)
    Adds to an existing statistics entry.
    protected void
    set(K key, int legs, int distance, double hours)
    Adds a statistics entry.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LegHoursStatsEntry

      LegHoursStatsEntry()
  • Method Details

    • getKeys

      public Collection<K> getKeys()
      Returns tthe available keys.
      Returns:
      a Collection of keys
    • getLegs

      public int getLegs(K key)
      Returns the number of flight legs for a particular key.
      Parameters:
      key - the key value
      Returns:
      the number of legs
    • getDistance

      public int getDistance(K key)
      Returns the flight distance for a particular key.
      Parameters:
      key - the key value
      Returns:
      the distance in miles
    • getHours

      public double getHours(K key)
      Returns the number of flight hours for a particular key.
      Parameters:
      key - the key value
      Returns:
      the number of hours
    • getMaxKey

      protected K getMaxKey()
      Returns the maximum key value in this bean.
      Returns:
      the highest key value
    • set

      protected void set(K key, int legs, int distance, double hours)
      Adds a statistics entry.
      Parameters:
      key - the key
      legs - the number of flight legs
      distance - the flight distance in miles
      hours - the number of flight hours
    • inc

      protected void inc(K key, int distance, double hours)
      Adds to an existing statistics entry.
      Parameters:
      key - the key
      distance - the flight distance in miles
      hours - the number of flight hours