Skip to content

Commit

Permalink
Touchups after pulling updates from main branch. Added javadoc commen…
Browse files Browse the repository at this point in the history
…ts to most interface declarations.
  • Loading branch information
Emily Curtin committed Mar 2, 2017
1 parent f127ee1 commit c615ac6
Show file tree
Hide file tree
Showing 39 changed files with 151 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,26 @@
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Service;

/**
* Holder for Application Context
*/
@Service
public class ApplicationContextHolder implements ApplicationContextAware {

private static ApplicationContext applicationContext;

/**
* Updater for ApplicationContextReference
*/
private static class ApplicationContextReferenceUpdater {
void updateApplicationContextReference(final ApplicationContext applicationContext) {
ApplicationContextHolder.applicationContext = applicationContext;
}
}

/**
* Holder for ApplicationContextReferenceUpdater
*/
private static class ApplicationContextReferenceUpdaterHolder {
static ApplicationContextReferenceUpdater INSTANCE = new ApplicationContextReferenceUpdater();
}
Expand All @@ -24,11 +33,18 @@ private ApplicationContextHolder() {
super();
}

/**
* @param applicationContext
* @throws BeansException
*/
@Override
public void setApplicationContext(final ApplicationContext applicationContext) throws BeansException {
ApplicationContextReferenceUpdaterHolder.INSTANCE.updateApplicationContextReference(applicationContext);
}

/**
* @return
*/
public static ApplicationContext getApplicationContext() {
return ApplicationContextHolder.applicationContext;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl;

/**
* Constants
*/
public class Constants {

public static final String AN_ATTEMPT_WAS_MADE_TO_DIVIDE_BY_ZERO = "An attempt was made to divide by zero.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.FizzBuzz;
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.parameters.FizzBuzzUpperLimitParameter;

/**
* Main
*/
public final class Main {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.factories.FizzBuzzSolutionStrategyFactory;
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.strategies.FizzBuzzSolutionStrategy;

/**
* Standard FizzBuzz
*/
@Service
public class StandardFizzBuzz implements FizzBuzz {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public LoopRunner(final LoopContextStateManipulation stateManipulation,
}

/**
* @return
*/
public void runLoop() {
for (this.myStateManipulation.start(); this.myStateManipulation.shouldProceed(); this.myStateManipulation.proceed()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl.strategies.converters.primitivetypesconverters.DoubleToIntConverter;
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl.strategies.converters.primitivetypesconverters.IntToDoubleConverter;

/**
* IntegerDivider
*/
@Service
public class IntegerDivider {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl.strategies.comparators.integercomparator.IntegerForEqualityComparator;

/**
* NumberIsMultipleOfAnotherNumberVerifier
*/
@Service
public class NumberIsMultipleOfAnotherNumberVerifier {

Expand All @@ -17,13 +20,21 @@ public class NumberIsMultipleOfAnotherNumberVerifier {
@Autowired
private ApplicationContextHolder applicationContextHolder;

/**
* @return
*/
@PostConstruct
public void init() {
final ApplicationContext applicationContext = applicationContextHolder.getApplicationContext();

this.integerDivider = applicationContext.getBean(IntegerDivider.class);
}

/**
* @param nFirstNumber
* @param nSecondNumber
* @return
*/
public static boolean numberIsMultipleOfAnotherNumber(final int nFirstNumber, final int nSecondNumber) {
try {
final int nDivideFirstIntegerBySecondIntegerResult =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,17 @@

import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl.factories.SystemOutFizzBuzzOutputStrategyFactory;

/**
* Printer for Buzz
*/
@Service
public class BuzzPrinter {

private final SystemOutFizzBuzzOutputStrategyFactory _systemOutFizzBuzzOutputStrategyFactory;

/**
* @param _systemOutFizzBuzzOutputStrategyFactory
*/
@Autowired
public BuzzPrinter(final SystemOutFizzBuzzOutputStrategyFactory _systemOutFizzBuzzOutputStrategyFactory) {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,17 @@

import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl.factories.SystemOutFizzBuzzOutputStrategyFactory;

/**
* Printer for Fizz
*/
@Service
public class FizzPrinter {

private final SystemOutFizzBuzzOutputStrategyFactory _systemOutFizzBuzzOutputStrategyFactory;

/**
* @param _systemOutFizzBuzzOutputStrategyFactory
*/
@Autowired
public FizzPrinter(final SystemOutFizzBuzzOutputStrategyFactory _systemOutFizzBuzzOutputStrategyFactory) {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,17 @@

import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl.factories.SystemOutFizzBuzzOutputStrategyFactory;

/**
* Printer for Integers
*/
@Service
public class IntegerPrinter {

private final SystemOutFizzBuzzOutputStrategyFactory _systemOutFizzBuzzOutputStrategyFactory;

/**
* @param _systemOutFizzBuzzOutputStrategyFactory
*/
@Autowired
public IntegerPrinter(final SystemOutFizzBuzzOutputStrategyFactory _systemOutFizzBuzzOutputStrategyFactory) {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,17 @@

import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl.factories.SystemOutFizzBuzzOutputStrategyFactory;

/**
* Printer for New Line
*/
@Service
public class NewLinePrinter {

private final SystemOutFizzBuzzOutputStrategyFactory _systemOutFizzBuzzOutputStrategyFactory;

/**
* @param _systemOutFizzBuzzOutputStrategyFactory
*/
@Autowired
public NewLinePrinter(final SystemOutFizzBuzzOutputStrategyFactory _systemOutFizzBuzzOutputStrategyFactory) {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.strategies.IsEvenlyDivisibleStrategy;
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.visitors.OutputGenerationContext;

/**
* Context for FizzBuzzOutputGeneration
*/
public final class FizzBuzzOutputGenerationContext implements OutputGenerationContext {

private final DataPrinter printer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.visitors.OutputGenerationContext;
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.visitors.OutputGenerationContextVisitor;

/**
* Visitor for FizzBuzzOutputGenerationContext
*/
@Service
public class FizzBuzzOutputGenerationContextVisitor implements
OutputGenerationContextVisitor {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces;

/**
* FizzBuzz
*/
public interface FizzBuzz {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.strategies.FizzBuzzOutputStrategy;

/**
* Factory for FizzBuzzOutputStrategy
*/
public interface FizzBuzzOutputStrategyFactory {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.strategies.FizzBuzzSolutionStrategy;

/**
* Factory for FizzBuzzSolutionStrategy
*/
public interface FizzBuzzSolutionStrategyFactory {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.printers.IntegerPrinter;

/**
* Factory for IntegerPrinter
*/
public interface IntegerPrinterFactory {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.stringreturners.IntegerStringReturner;

/**
* Factory for IntegerStringReturner
*/
public interface IntegerStringReturnerFactory {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.strategies.IsEvenlyDivisibleStrategy;

/**
* Factory for IsEvenlyDivisibleStrategy
*/
public interface IsEvenlyDivisibleStrategyFactory {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.visitors.OutputGenerationContextVisitor;

/**
* Factory for OutputGenerationContextVisitor
*/
public interface OutputGenerationContextVisitorFactory {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.printers.StringPrinter;

/**
* Factory for StringPrinter
*/
public interface StringPrinterFactory {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.stringreturners.StringStringReturner;

/**
* Factory for StringStringReturner
*/
public interface StringStringReturnerFactory {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.loop;

/**
* Manipulation for LoopContextState
*/
public interface LoopContextStateManipulation {

/**
*
* @return
*/
public void start();

Expand All @@ -13,7 +16,7 @@ public interface LoopContextStateManipulation {
public boolean shouldProceed();

/**
*
* @return
*/
public void proceed();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.loop;

/**
* Retrieval for LoopContextState
*/
public interface LoopContextStateRetrieval {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.loop;

/**
* Execution for LoopPayload
*/
public interface LoopPayloadExecution {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.parameters;

/**
* Parameter for FizzBuzzUpperLimit
*/
public interface FizzBuzzUpperLimitParameter {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.printers;

/**
* Printer for Data
*/
public interface DataPrinter {

/**
*
* @return
*/
public void print();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.printers;

/**
* Printer for Integer
*/
public interface IntegerPrinter extends DataPrinter {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.printers;

/**
* Printer for String
*/
public interface StringPrinter extends DataPrinter {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.strategies;

/**
* Strategy for FizzBuzzExceptionSafeOutput
*/
public interface FizzBuzzExceptionSafeOutputStrategy {

/**
Expand Down
Loading

0 comments on commit c615ac6

Please sign in to comment.