diff --git a/src/main/java/fr/mieuxvoter/mj/TallyNormalized.java b/src/main/java/fr/mieuxvoter/mj/NormalizedTally.java similarity index 88% rename from src/main/java/fr/mieuxvoter/mj/TallyNormalized.java rename to src/main/java/fr/mieuxvoter/mj/NormalizedTally.java index 0a81ec0..1940207 100644 --- a/src/main/java/fr/mieuxvoter/mj/TallyNormalized.java +++ b/src/main/java/fr/mieuxvoter/mj/NormalizedTally.java @@ -3,9 +3,9 @@ package fr.mieuxvoter.mj; import java.math.BigInteger; import java.security.InvalidParameterException; -public class TallyNormalized extends Tally implements TallyInterface { +public class NormalizedTally extends Tally implements TallyInterface { - public TallyNormalized(ProposalTallyInterface[] proposalsTallies) { + public NormalizedTally(ProposalTallyInterface[] proposalsTallies) { super(proposalsTallies); Integer amountOfProposals = getAmountOfProposals(); @@ -21,13 +21,13 @@ public class TallyNormalized extends Tally implements TallyInterface { // Normalize proposals to the LCM ProposalTally[] normalizedTallies = new ProposalTally[amountOfProposals]; - for (int i = 0 ; i < amountOfProposals ; i++ ) { + for (int i = 0 ; i < amountOfProposals ; i++) { ProposalTallyInterface proposalTally = proposalsTallies[i]; ProposalTally normalizedTally = new ProposalTally(proposalTally); BigInteger factor = amountOfJudges.divide(proposalTally.getAmountOfJudgments()); Integer amountOfGrades = proposalTally.getTally().length; BigInteger[] gradesTallies = normalizedTally.getTally(); - for (int j = 0 ; j < amountOfGrades; j++ ) { + for (int j = 0 ; j < amountOfGrades; j++) { gradesTallies[j] = gradesTallies[j].multiply(factor); } normalizedTallies[i] = normalizedTally; diff --git a/src/test/java/fr/mieuxvoter/mj/MajorityJudgmentDeliberatorTest.java b/src/test/java/fr/mieuxvoter/mj/MajorityJudgmentDeliberatorTest.java index d0d3215..c9544a5 100644 --- a/src/test/java/fr/mieuxvoter/mj/MajorityJudgmentDeliberatorTest.java +++ b/src/test/java/fr/mieuxvoter/mj/MajorityJudgmentDeliberatorTest.java @@ -75,7 +75,7 @@ class MajorityJudgmentDeliberatorTest { if ("StaticDefault".equalsIgnoreCase(mode)) { tally = new TallyWithDefaultGrade(tallies, amountOfParticipants, datum.getInt("default")); } else if ("Normalized".equalsIgnoreCase(mode)) { - tally = new TallyNormalized(tallies); + tally = new NormalizedTally(tallies); } else { tally = new Tally(tallies, amountOfParticipants); }