Class SolutionLoader
java.lang.Object
com.expedient.adventofcodejade.common.SolutionLoader
Class responsible for dynamically loading Solutions located in
com.expedient.adventofcodejade.solutions.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionloadForDay(int year, int day, boolean test) Dynamically load the Solution class in the package for the given dayloadSolutions(int year, boolean test) Tries to get solutions for days 1-25, breaks out of the loop is any are missing.
-
Constructor Details
-
SolutionLoader
-
SolutionLoader
public SolutionLoader()
-
-
Method Details
-
loadForDay
public BaseSolution loadForDay(int year, int day, boolean test) throws ClassNotFoundException, RuntimeException, IOException Dynamically load the Solution class in the package for the given day- Parameters:
day- the day of the month to use for the solution- Returns:
- The BaseSolution instance for the given day, located in the day's respective package as a class named "Solution"
- Throws:
ClassNotFoundException- there's no class for the given dayRuntimeException- there's some other error with the constructor or somethingIOException- the sample input could not be found
-
loadSolutions
Tries to get solutions for days 1-25, breaks out of the loop is any are missing. There should never be more than 25 days before Christmas lol- Returns:
- Array of BaseSolution instances
- Throws:
RuntimeException- Some error was encountered instantiating the classes
-