Record Class ApportionmentMethods.ApportionmentResult
java.lang.Object
java.lang.Record
org.episteme.social.politics.ApportionmentMethods.ApportionmentResult
- All Implemented Interfaces:
Serializable
- Enclosing class:
ApportionmentMethods
public static record ApportionmentMethods.ApportionmentResult(Map<String,Integer> seats, String method, double gallagherIndex)
extends Record
implements Serializable
Aggregated results of an apportionment calculation.
- Since:
- 1.0
- Version:
- 1.1
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionApportionmentResult(Map<String, Integer> seats, String method, double gallagherIndex) Creates an instance of aApportionmentResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.doubleReturns the value of thegallagherIndexrecord component.final inthashCode()Returns a hash code value for this object.method()Returns the value of themethodrecord component.seats()Returns the value of theseatsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ApportionmentResult
Creates an instance of aApportionmentResultrecord class.- Parameters:
seats- the value for theseatsrecord componentmethod- the value for themethodrecord componentgallagherIndex- the value for thegallagherIndexrecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
seats
-
method
Returns the value of themethodrecord component.- Returns:
- the value of the
methodrecord component
-
gallagherIndex
public double gallagherIndex()Returns the value of thegallagherIndexrecord component.- Returns:
- the value of the
gallagherIndexrecord component
-