Class Census
java.lang.Object
org.episteme.social.sociology.Census
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleCalculates the average age of the population.Returns the distribution of genders within the population.intReturns the total number of individuals in the census.
-
Constructor Details
-
Census
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
-