Skip to content

Commit

Permalink
Fix methematical terminology (addend)
Browse files Browse the repository at this point in the history
  • Loading branch information
yurloc authored and ge0ffrey committed Apr 3, 2019
1 parent 0149e43 commit feba7fa
Show file tree
Hide file tree
Showing 16 changed files with 67 additions and 67 deletions.
Expand Up @@ -73,15 +73,15 @@ public double[] getPercentageLevels() {
// Worker methods
// ************************************************************************

public ScoreDifferencePercentage add(ScoreDifferencePercentage augment) {
if (percentageLevels.length != augment.getPercentageLevels().length) {
throw new IllegalStateException("The augment (" + augment + ")'s levelsLength (" +
augment.getPercentageLevels().length + ") is different from the base (" +
public ScoreDifferencePercentage add(ScoreDifferencePercentage addend) {
if (percentageLevels.length != addend.getPercentageLevels().length) {
throw new IllegalStateException("The addend (" + addend + ")'s levelsLength (" +
addend.getPercentageLevels().length + ") is different from the base (" +
this + ")'s levelsLength (" + percentageLevels.length + ").");
}
double[] newPercentageLevels = new double[percentageLevels.length];
for (int i = 0; i < percentageLevels.length; i++) {
newPercentageLevels[i] = percentageLevels[i] + augment.percentageLevels[i];
newPercentageLevels[i] = percentageLevels[i] + addend.percentageLevels[i];
}
return new ScoreDifferencePercentage(newPercentageLevels);
}
Expand Down
Expand Up @@ -67,11 +67,11 @@ public interface Score<Score_ extends Score> extends Comparable<Score_> {
Score_ withInitScore(int newInitScore);

/**
* Returns a Score whose value is (this + augment).
* @param augment value to be added to this Score
* @return this + augment
* Returns a Score whose value is (this + addend).
* @param addend value to be added to this Score
* @return this + addend
*/
Score_ add(Score_ augment);
Score_ add(Score_ addend);

/**
* Returns a Score whose value is (this - subtrahend).
Expand Down
Expand Up @@ -247,18 +247,18 @@ public boolean isFeasible() {
}

@Override
public BendableScore add(BendableScore augment) {
validateCompatible(augment);
public BendableScore add(BendableScore addend) {
validateCompatible(addend);
int[] newHardScores = new int[hardScores.length];
int[] newSoftScores = new int[softScores.length];
for (int i = 0; i < newHardScores.length; i++) {
newHardScores[i] = hardScores[i] + augment.getHardScore(i);
newHardScores[i] = hardScores[i] + addend.getHardScore(i);
}
for (int i = 0; i < newSoftScores.length; i++) {
newSoftScores[i] = softScores[i] + augment.getSoftScore(i);
newSoftScores[i] = softScores[i] + addend.getSoftScore(i);
}
return new BendableScore(
initScore + augment.getInitScore(),
initScore + addend.getInitScore(),
newHardScores, newSoftScores);
}

Expand Down
Expand Up @@ -257,18 +257,18 @@ public boolean isFeasible() {
}

@Override
public BendableBigDecimalScore add(BendableBigDecimalScore augment) {
validateCompatible(augment);
public BendableBigDecimalScore add(BendableBigDecimalScore addend) {
validateCompatible(addend);
BigDecimal[] newHardScores = new BigDecimal[hardScores.length];
BigDecimal[] newSoftScores = new BigDecimal[softScores.length];
for (int i = 0; i < newHardScores.length; i++) {
newHardScores[i] = hardScores[i].add(augment.getHardScore(i));
newHardScores[i] = hardScores[i].add(addend.getHardScore(i));
}
for (int i = 0; i < newSoftScores.length; i++) {
newSoftScores[i] = softScores[i].add(augment.getSoftScore(i));
newSoftScores[i] = softScores[i].add(addend.getSoftScore(i));
}
return new BendableBigDecimalScore(
initScore + augment.getInitScore(),
initScore + addend.getInitScore(),
newHardScores, newSoftScores);
}

Expand Down
Expand Up @@ -245,18 +245,18 @@ public boolean isFeasible() {
}

@Override
public BendableLongScore add(BendableLongScore augment) {
validateCompatible(augment);
public BendableLongScore add(BendableLongScore addend) {
validateCompatible(addend);
long[] newHardScores = new long[hardScores.length];
long[] newSoftScores = new long[softScores.length];
for (int i = 0; i < newHardScores.length; i++) {
newHardScores[i] = hardScores[i] + augment.getHardScore(i);
newHardScores[i] = hardScores[i] + addend.getHardScore(i);
}
for (int i = 0; i < newSoftScores.length; i++) {
newSoftScores[i] = softScores[i] + augment.getSoftScore(i);
newSoftScores[i] = softScores[i] + addend.getSoftScore(i);
}
return new BendableLongScore(
initScore + augment.getInitScore(),
initScore + addend.getInitScore(),
newHardScores, newSoftScores);
}

Expand Down
Expand Up @@ -171,12 +171,12 @@ public boolean isFeasible() {
}

@Override
public HardMediumSoftScore add(HardMediumSoftScore augment) {
public HardMediumSoftScore add(HardMediumSoftScore addend) {
return new HardMediumSoftScore(
initScore + augment.getInitScore(),
hardScore + augment.getHardScore(),
mediumScore + augment.getMediumScore(),
softScore + augment.getSoftScore());
initScore + addend.getInitScore(),
hardScore + addend.getHardScore(),
mediumScore + addend.getMediumScore(),
softScore + addend.getSoftScore());
}

@Override
Expand Down
Expand Up @@ -174,12 +174,12 @@ public boolean isFeasible() {
}

@Override
public HardMediumSoftBigDecimalScore add(HardMediumSoftBigDecimalScore augment) {
public HardMediumSoftBigDecimalScore add(HardMediumSoftBigDecimalScore addend) {
return new HardMediumSoftBigDecimalScore(
initScore + augment.getInitScore(),
hardScore.add(augment.getHardScore()),
mediumScore.add(augment.getMediumScore()),
softScore.add(augment.getSoftScore()));
initScore + addend.getInitScore(),
hardScore.add(addend.getHardScore()),
mediumScore.add(addend.getMediumScore()),
softScore.add(addend.getSoftScore()));
}

@Override
Expand Down
Expand Up @@ -171,12 +171,12 @@ public boolean isFeasible() {
}

@Override
public HardMediumSoftLongScore add(HardMediumSoftLongScore augment) {
public HardMediumSoftLongScore add(HardMediumSoftLongScore addend) {
return new HardMediumSoftLongScore(
initScore + augment.getInitScore(),
hardScore + augment.getHardScore(),
mediumScore + augment.getMediumScore(),
softScore + augment.getSoftScore());
initScore + addend.getInitScore(),
hardScore + addend.getHardScore(),
mediumScore + addend.getMediumScore(),
softScore + addend.getSoftScore());
}

@Override
Expand Down
Expand Up @@ -142,11 +142,11 @@ public boolean isFeasible() {
}

@Override
public HardSoftScore add(HardSoftScore augment) {
public HardSoftScore add(HardSoftScore addend) {
return new HardSoftScore(
initScore + augment.getInitScore(),
hardScore + augment.getHardScore(),
softScore + augment.getSoftScore());
initScore + addend.getInitScore(),
hardScore + addend.getHardScore(),
softScore + addend.getSoftScore());
}

@Override
Expand Down
Expand Up @@ -146,11 +146,11 @@ public boolean isFeasible() {
}

@Override
public HardSoftBigDecimalScore add(HardSoftBigDecimalScore augment) {
public HardSoftBigDecimalScore add(HardSoftBigDecimalScore addend) {
return new HardSoftBigDecimalScore(
initScore + augment.getInitScore(),
hardScore.add(augment.getHardScore()),
softScore.add(augment.getSoftScore()));
initScore + addend.getInitScore(),
hardScore.add(addend.getHardScore()),
softScore.add(addend.getSoftScore()));
}

@Override
Expand Down
Expand Up @@ -148,11 +148,11 @@ public boolean isFeasible() {
}

@Override
public HardSoftDoubleScore add(HardSoftDoubleScore augment) {
public HardSoftDoubleScore add(HardSoftDoubleScore addend) {
return new HardSoftDoubleScore(
initScore + augment.getInitScore(),
hardScore + augment.getHardScore(),
softScore + augment.getSoftScore());
initScore + addend.getInitScore(),
hardScore + addend.getHardScore(),
softScore + addend.getSoftScore());
}

@Override
Expand Down
Expand Up @@ -143,11 +143,11 @@ public boolean isFeasible() {
}

@Override
public HardSoftLongScore add(HardSoftLongScore augment) {
public HardSoftLongScore add(HardSoftLongScore addend) {
return new HardSoftLongScore(
initScore + augment.getInitScore(),
hardScore + augment.getHardScore(),
softScore + augment.getSoftScore());
initScore + addend.getInitScore(),
hardScore + addend.getHardScore(),
softScore + addend.getSoftScore());
}

@Override
Expand Down
Expand Up @@ -108,10 +108,10 @@ public SimpleScore withInitScore(int newInitScore) {
}

@Override
public SimpleScore add(SimpleScore augment) {
public SimpleScore add(SimpleScore addend) {
return new SimpleScore(
initScore + augment.getInitScore(),
score + augment.getScore());
initScore + addend.getInitScore(),
score + addend.getScore());
}

@Override
Expand Down
Expand Up @@ -111,10 +111,10 @@ public SimpleBigDecimalScore withInitScore(int newInitScore) {
}

@Override
public SimpleBigDecimalScore add(SimpleBigDecimalScore augment) {
public SimpleBigDecimalScore add(SimpleBigDecimalScore addend) {
return new SimpleBigDecimalScore(
initScore + augment.getInitScore(),
score.add(augment.getScore()));
initScore + addend.getInitScore(),
score.add(addend.getScore()));
}

@Override
Expand Down
Expand Up @@ -113,10 +113,10 @@ public SimpleDoubleScore withInitScore(int newInitScore) {
}

@Override
public SimpleDoubleScore add(SimpleDoubleScore augment) {
public SimpleDoubleScore add(SimpleDoubleScore addend) {
return new SimpleDoubleScore(
initScore + augment.getInitScore(),
score + augment.getScore());
initScore + addend.getInitScore(),
score + addend.getScore());
}

@Override
Expand Down
Expand Up @@ -108,10 +108,10 @@ public SimpleLongScore withInitScore(int newInitScore) {
}

@Override
public SimpleLongScore add(SimpleLongScore augment) {
public SimpleLongScore add(SimpleLongScore addend) {
return new SimpleLongScore(
initScore + augment.getInitScore(),
score + augment.getScore());
initScore + addend.getInitScore(),
score + addend.getScore());
}

@Override
Expand Down

0 comments on commit feba7fa

Please sign in to comment.