Package edu.ucsb.cs156.happiercows.jobs
Class UpdateCowHealthJob
java.lang.Object
edu.ucsb.cs156.happiercows.jobs.UpdateCowHealthJob
- All Implemented Interfaces:
JobContextConsumer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(JobContext ctx) static void
calculateCowDeaths
(UserCommons userCommons, JobContext ctx) static double
calculateNewCowHealthUsingStrategy
(CowHealthUpdateStrategy strategy, CommonsPlus commonsPlus, UserCommons userCommons, int totalCows) static void
runUpdateJobInCommons
(Commons commons, CommonsPlus commonsPlus, CommonsPlusBuilderService commonsPlusBuilderService, CommonsRepository commonsRepository, UserCommonsRepository userCommonsRepository, JobContext ctx)
-
Constructor Details
-
UpdateCowHealthJob
public UpdateCowHealthJob()
-
-
Method Details
-
accept
- Specified by:
accept
in interfaceJobContextConsumer
- Throws:
Exception
-
calculateNewCowHealthUsingStrategy
public static double calculateNewCowHealthUsingStrategy(CowHealthUpdateStrategy strategy, CommonsPlus commonsPlus, UserCommons userCommons, int totalCows) -
calculateCowDeaths
-
runUpdateJobInCommons
public static void runUpdateJobInCommons(Commons commons, CommonsPlus commonsPlus, CommonsPlusBuilderService commonsPlusBuilderService, CommonsRepository commonsRepository, UserCommonsRepository userCommonsRepository, JobContext ctx)
-