Record Class DemographicData.AgeGroup
java.lang.Object
java.lang.Record
org.episteme.social.sociology.DemographicData.AgeGroup
- All Implemented Interfaces:
Serializable
- Enclosing class:
DemographicData
public static record DemographicData.AgeGroup(int minAge, int maxAge, long maleCount, long femaleCount)
extends Record
implements Serializable
Represents a single age-cohort segment within a demographic structure.
- Since:
- 1.0
- Version:
- 1.1
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAgeGroup(int minAge, int maxAge, long maleCount, long femaleCount) Creates an instance of aAgeGrouprecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.longReturns the value of thefemaleCountrecord component.final inthashCode()Returns a hash code value for this object.longReturns the value of themaleCountrecord component.intmaxAge()Returns the value of themaxAgerecord component.intminAge()Returns the value of theminAgerecord component.final StringtoString()Returns a string representation of this record class.longtotal()Returns the total count for this age SociologicalGroup.
-
Constructor Details
-
AgeGroup
public AgeGroup(int minAge, int maxAge, long maleCount, long femaleCount) Creates an instance of aAgeGrouprecord class.- Parameters:
minAge- the value for theminAgerecord componentmaxAge- the value for themaxAgerecord componentmaleCount- the value for themaleCountrecord componentfemaleCount- the value for thefemaleCountrecord component
-
-
Method Details
-
total
public long total()Returns the total count for this age SociologicalGroup. -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
minAge
public int minAge()Returns the value of theminAgerecord component.- Returns:
- the value of the
minAgerecord component
-
maxAge
public int maxAge()Returns the value of themaxAgerecord component.- Returns:
- the value of the
maxAgerecord component
-
maleCount
public long maleCount()Returns the value of themaleCountrecord component.- Returns:
- the value of the
maleCountrecord component
-
femaleCount
public long femaleCount()Returns the value of thefemaleCountrecord component.- Returns:
- the value of the
femaleCountrecord component
-