Class Census

java.lang.Object
org.episteme.social.sociology.Census
All Implemented Interfaces:
Serializable

public class Census extends Object implements Serializable
Represents a systematic collection of demographic data for a population of individuals. Provides analytical methods for population statistics like average age and gender distribution. * @version 1.1
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
See Also:
  • Constructor Details

    • Census

      public Census(List<Person> population)
      Creates a new Census for the given population.
      Parameters:
      population - the list of people to analyze
      Throws:
      NullPointerException - if population is null
  • Method Details

    • getTotalPopulation

      public int getTotalPopulation()
      Returns the total number of individuals in the census.
      Returns:
      population size
    • getAverageAge

      public double getAverageAge()
      Calculates the average age of the population.
      Returns:
      average age in years, or 0.0 if population is empty
    • getGenderDistribution

      public Map<Gender,Long> getGenderDistribution()
      Returns the distribution of genders within the population.
      Returns:
      a map from gender to the count of individuals