Class SkillStats


  • public class SkillStats
    extends java.lang.Object
    A class for holding statistic information about units and their skills like number of persons with a specified skill or total skillpoints or things like that. Units can be added by a call to the addUnit-Method but not removed.
    Author:
    Ulrich Küster
    • Constructor Summary

      Constructors 
      Constructor Description
      SkillStats()
      Default constructor
      SkillStats​(java.util.List<Unit> units)
      Constructor that initialize the internal data with the given units
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addUnit​(Unit u)
      adds a unit to the internal statistics
      int getHighestKnownSkillLevel​(SkillType type)
      returns the highest level of the specified skillType known in the internal data
      java.util.List<Skill> getKnownSkills​(SkillType type)
      returns a sorted Collection containing the existing entries (type Skill) for the specified SkillType in the internal data.
      java.util.List<SkillType> getKnownSkillTypes()
      returns an Collection containing the known SkillTypes in the internal data.
      int getLowestKnownSkillLevel​(SkillType type)
      returns the lowest level of the specified skillType known in the internal data
      int getPersonNumber​(SkillType skillType)
      returns the total number of persons that master the specified SkillType at any level (also level 0, as long as they have more than zero skillpoints of this skillType)
      int getPersonNumber​(Skill skill)
      returns the number of persons that master the specified skill at exact that level, specified in the skill Object.
      int getSkillLevelNumber​(SkillType skillType)
      returns the total number of skilllevel of the specified SkillType
      int getSkillLevelNumber​(Skill skill)
      just like getSkillLevelNumber(SkillType) but limited to a level
      int getSkillPointsNumber​(SkillType skillType)
      returns the total number of days learned yet the specified SkillType
      int getSkillPointsNumber​(Skill skill)
      just like getSkillPointsNumber(SkillType) but limited to a single level
      java.util.List<Unit> getUnits​(Skill skill)
      returns a List containing the units with the specified skill at the specified level
      • Methods inherited from class java.lang.Object

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

      • SkillStats

        public SkillStats()
        Default constructor
      • SkillStats

        public SkillStats​(java.util.List<Unit> units)
        Constructor that initialize the internal data with the given units
    • Method Detail

      • getUnits

        public java.util.List<Unit> getUnits​(Skill skill)
        returns a List containing the units with the specified skill at the specified level
      • getPersonNumber

        public int getPersonNumber​(Skill skill)
        returns the number of persons that master the specified skill at exact that level, specified in the skill Object. That means, a call with a skill-Object containing let's say skilllevel 5, will not consider persons, that master this skill at a higher level
      • getSkillPointsNumber

        public int getSkillPointsNumber​(SkillType skillType)
        returns the total number of days learned yet the specified SkillType
      • getSkillPointsNumber

        public int getSkillPointsNumber​(Skill skill)
        just like getSkillPointsNumber(SkillType) but limited to a single level
      • getSkillLevelNumber

        public int getSkillLevelNumber​(SkillType skillType)
        returns the total number of skilllevel of the specified SkillType
      • getSkillLevelNumber

        public int getSkillLevelNumber​(Skill skill)
        just like getSkillLevelNumber(SkillType) but limited to a level
      • getPersonNumber

        public int getPersonNumber​(SkillType skillType)
        returns the total number of persons that master the specified SkillType at any level (also level 0, as long as they have more than zero skillpoints of this skillType)
      • getKnownSkills

        public java.util.List<Skill> getKnownSkills​(SkillType type)
        returns a sorted Collection containing the existing entries (type Skill) for the specified SkillType in the internal data. If type == null returns a Collection containing all existing entries (for all skilltypes)
      • getKnownSkillTypes

        public java.util.List<SkillType> getKnownSkillTypes()
        returns an Collection containing the known SkillTypes in the internal data.
      • getLowestKnownSkillLevel

        public int getLowestKnownSkillLevel​(SkillType type)
        returns the lowest level of the specified skillType known in the internal data
      • getHighestKnownSkillLevel

        public int getHighestKnownSkillLevel​(SkillType type)
        returns the highest level of the specified skillType known in the internal data
      • addUnit

        public void addUnit​(Unit u)
        adds a unit to the internal statistics