Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Not enough comments" #607 patch #608

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Finished NoFizzNoBuzzStrategy and Printers
dashmatic authored Oct 16, 2022
commit 647873842218371a497104a31f0d922b218799f8
21 changes: 18 additions & 3 deletions patch-1-notes.md
Original file line number Diff line number Diff line change
@@ -5,11 +5,16 @@ This pull request be to fix issue #607.
NOTE: This file be to be removed after all commenting be done.


ANOTHER NOTE: "<...>" be used to skip through many empty directories.
For example, "/src/<...>/impl" be used to direct the reader to
ANOTHER NOTE:
"<...>" be used to skip through many empty directories.
For example,
"/src/<...>/impl"
be used to direct the reader to
/src/main/java/com/seriouscompany/business/java/fizzbuzz/packagenamingpackage/impl.

Another example, "/resources/<...>/spring.xml" be used to direct the reader to
Another example,
"/resources/<...>/spring.xml"
be used to direct the reader to
/resources/assets/configuration/spring/dependencyinjection/configuration/spring.xml.

## DONE!
@@ -33,6 +38,10 @@ Another example, "/resources/<...>/spring.xml" be used to direct the reader to

- /src/<...>/impl/factories/NoFizzNoBuzzStrategyFactory.java

#### /src/<...>/impl/strategies

- /src/<...>/impl/strategies/NoFizzNoBuzzStrategy.java

### /src/<...>/interfaces

- /src/<...>/interfaces/FizzBuzz.java
@@ -41,6 +50,12 @@ Another example, "/resources/<...>/spring.xml" be used to direct the reader to

- /src/<...>/interfaces/parameters/FizzBuzzUpperLimitParameter.java

### /src/<...>/interfaces/printers

- /src/<...>/interfaces/printers/DataPrinter.java
- /src/<...>/interfaces/printers/StringPrinter.java
- /src/<...>/interfaces/printers/IntegerPrinter.java

## IN PROGRESS

undefined
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
// NoFizzNoBuzzStrategy.java
// Strategy for NoFizzNoBuzz

// add to package com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl.strategies
package com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl.strategies;

// imports org.springframework.stereotype.Service
import org.springframework.stereotype.Service;

// imports com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.strategies.IsEvenlyDivisibleStrategy
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.strategies.IsEvenlyDivisibleStrategy;
// imports com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl.strategies.constants.NoFizzNoBuzzStrategyConstants
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl.strategies.constants.NoFizzNoBuzzStrategyConstants;
// imports com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl.math.arithmetics.NumberIsMultipleOfAnotherNumberVerifier
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl.math.arithmetics.NumberIsMultipleOfAnotherNumberVerifier;

/**
@@ -17,23 +25,32 @@ public class NoFizzNoBuzzStrategy implements IsEvenlyDivisibleStrategy {
* @return boolean
*/
public boolean isEvenlyDivisible(final int theInteger) {
// call the method `numberIsMultipleOfAnotherNumber` from `NumberIsMultipleOfAnotherNumberVerifier` and pass argument parameter constant `theInteger` and argument constant `NO_FIZZ_INTEGER_CONSTANT_VALUE` from `NoFizzNoBuzzStrategyConstants`
if (!NumberIsMultipleOfAnotherNumberVerifier.numberIsMultipleOfAnotherNumber(theInteger,
NoFizzNoBuzzStrategyConstants.NO_FIZZ_INTEGER_CONSTANT_VALUE)) {
// if number is multiple of another number is not true, call the method numberIsMultipleOfAnotherNumber` from `NumberIsMultipleOfAnotherNumberVerifier` and pass argument parameter constant `theInteger` and argument constant `NO_BUZZ_INTEGER_CONSTANT_VALUE` from `NoFizzNoBuzzStrategyConstants`
if (!NumberIsMultipleOfAnotherNumberVerifier.numberIsMultipleOfAnotherNumber(theInteger,
NoFizzNoBuzzStrategyConstants.NO_BUZZ_INTEGER_CONSTANT_VALUE)) {
// if number is multiple of another number is not true, return true
return true;
} else {
// otherwise, return false
return false;
}
} else if (!NumberIsMultipleOfAnotherNumberVerifier.numberIsMultipleOfAnotherNumber(theInteger,
NoFizzNoBuzzStrategyConstants.NO_BUZZ_INTEGER_CONSTANT_VALUE)) {
// if number is multiple of another number is not not true, call the method numberIsMultipleOfAnotherNumber` from `NumberIsMultipleOfAnotherNumberVerifier` and pass argument parameter constant `theInteger` and argument constant `NO_BUZZ_INTEGER_CONSTANT_VALUE` from `NoFizzNoBuzzStrategyConstants`
// call the method numberIsMultipleOfAnotherNumber` from `NumberIsMultipleOfAnotherNumberVerifier` and pass argument parameter constant `theInteger` and argument constant `NO_FIZZ_INTEGER_CONSTANT_VALUE` from `NoFizzNoBuzzStrategyConstants`
if (!NumberIsMultipleOfAnotherNumberVerifier.numberIsMultipleOfAnotherNumber(theInteger,
NoFizzNoBuzzStrategyConstants.NO_FIZZ_INTEGER_CONSTANT_VALUE)) {
// if number is multiple of another number is not true, return true
return true;
} else {
// otherwise, return false
return false;
}
} else {
// otherwise, return false
return false;
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// DataPrinter.java
// Printer for Data

// add to package com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.printers
package com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.printers;

/**
@@ -8,11 +12,11 @@ public interface DataPrinter {
/**
* @return
*/
public void print();
public void print(); // create a method to print which returns void and takes no parameters

/**
* @param value
*/
public void printValue(Object value);
public void printValue(Object value); // create a method to print a value which returns void and takes an Object parameter called `value`

}
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// IntegerPrinter.java
// Printer for Integer

// add to package com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.printers
package com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.printers;

/**
@@ -8,6 +12,6 @@ public interface IntegerPrinter extends DataPrinter {
/**
* @param theInteger
*/
public void printInteger(int theInteger);
public void printInteger(int theInteger); // create a method to print integers which returns void and takes an int parameter called `theInteger`

}
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// StringPrinter.java
// Printer for String

// add to package com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.printers
package com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.printers;

/**
@@ -8,6 +12,6 @@ public interface StringPrinter extends DataPrinter {
/**
*
*/
public void print();
public void print(); // create a method to print which returns void and takes no parameters

}