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 // Worker methods
// ************************************************************************ // ************************************************************************


public ScoreDifferencePercentage add(ScoreDifferencePercentage augment) { public ScoreDifferencePercentage add(ScoreDifferencePercentage addend) {
if (percentageLevels.length != augment.getPercentageLevels().length) { if (percentageLevels.length != addend.getPercentageLevels().length) {
throw new IllegalStateException("The augment (" + augment + ")'s levelsLength (" + throw new IllegalStateException("The addend (" + addend + ")'s levelsLength (" +
augment.getPercentageLevels().length + ") is different from the base (" + addend.getPercentageLevels().length + ") is different from the base (" +
this + ")'s levelsLength (" + percentageLevels.length + ")."); this + ")'s levelsLength (" + percentageLevels.length + ").");
} }
double[] newPercentageLevels = new double[percentageLevels.length]; double[] newPercentageLevels = new double[percentageLevels.length];
for (int i = 0; i < percentageLevels.length; i++) { 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); 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); Score_ withInitScore(int newInitScore);


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


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


@Override @Override
public BendableScore add(BendableScore augment) { public BendableScore add(BendableScore addend) {
validateCompatible(augment); validateCompatible(addend);
int[] newHardScores = new int[hardScores.length]; int[] newHardScores = new int[hardScores.length];
int[] newSoftScores = new int[softScores.length]; int[] newSoftScores = new int[softScores.length];
for (int i = 0; i < newHardScores.length; i++) { 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++) { 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( return new BendableScore(
initScore + augment.getInitScore(), initScore + addend.getInitScore(),
newHardScores, newSoftScores); newHardScores, newSoftScores);
} }


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


@Override @Override
public BendableBigDecimalScore add(BendableBigDecimalScore augment) { public BendableBigDecimalScore add(BendableBigDecimalScore addend) {
validateCompatible(augment); validateCompatible(addend);
BigDecimal[] newHardScores = new BigDecimal[hardScores.length]; BigDecimal[] newHardScores = new BigDecimal[hardScores.length];
BigDecimal[] newSoftScores = new BigDecimal[softScores.length]; BigDecimal[] newSoftScores = new BigDecimal[softScores.length];
for (int i = 0; i < newHardScores.length; i++) { 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++) { 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( return new BendableBigDecimalScore(
initScore + augment.getInitScore(), initScore + addend.getInitScore(),
newHardScores, newSoftScores); newHardScores, newSoftScores);
} }


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


@Override @Override
public BendableLongScore add(BendableLongScore augment) { public BendableLongScore add(BendableLongScore addend) {
validateCompatible(augment); validateCompatible(addend);
long[] newHardScores = new long[hardScores.length]; long[] newHardScores = new long[hardScores.length];
long[] newSoftScores = new long[softScores.length]; long[] newSoftScores = new long[softScores.length];
for (int i = 0; i < newHardScores.length; i++) { 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++) { 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( return new BendableLongScore(
initScore + augment.getInitScore(), initScore + addend.getInitScore(),
newHardScores, newSoftScores); newHardScores, newSoftScores);
} }


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


@Override @Override
Expand Down

0 comments on commit feba7fa

Please sign in to comment.