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

    Constructors
    Constructor
    Description
    AgeGroup(int minAge, int maxAge, long maleCount, long femaleCount)
    Creates an instance of a AgeGroup record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    long
    Returns the value of the femaleCount record component.
    final int
    Returns a hash code value for this object.
    long
    Returns the value of the maleCount record component.
    int
    Returns the value of the maxAge record component.
    int
    Returns the value of the minAge record component.
    final String
    Returns a string representation of this record class.
    long
    Returns the total count for this age SociologicalGroup.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • AgeGroup

      public AgeGroup(int minAge, int maxAge, long maleCount, long femaleCount)
      Creates an instance of a AgeGroup record class.
      Parameters:
      minAge - the value for the minAge record component
      maxAge - the value for the maxAge record component
      maleCount - the value for the maleCount record component
      femaleCount - the value for the femaleCount record component
  • Method Details

    • total

      public long total()
      Returns the total count for this age SociologicalGroup.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • minAge

      public int minAge()
      Returns the value of the minAge record component.
      Returns:
      the value of the minAge record component
    • maxAge

      public int maxAge()
      Returns the value of the maxAge record component.
      Returns:
      the value of the maxAge record component
    • maleCount

      public long maleCount()
      Returns the value of the maleCount record component.
      Returns:
      the value of the maleCount record component
    • femaleCount

      public long femaleCount()
      Returns the value of the femaleCount record component.
      Returns:
      the value of the femaleCount record component