Package edu.ucsb.cs156.happiercows.jobs
Class MilkTheCowsJob
java.lang.Object
edu.ucsb.cs156.happiercows.jobs.MilkTheCowsJob
- All Implemented Interfaces:
JobContextConsumer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(JobContext ctx) static doublecalculateMilkingProfit(Commons commons, UserCommons userCommons) Calculate the profit for a user from milking their cows.formatDollars(double amount) voidmilkCows(JobContext ctx, Commons commons, UserCommons userCommons) This method performs the function of milking the cows for a single userCommons.
-
Constructor Details
-
MilkTheCowsJob
public MilkTheCowsJob()
-
-
Method Details
-
formatDollars
-
accept
- Specified by:
acceptin interfaceJobContextConsumer- Throws:
Exception
-
milkCows
This method performs the function of milking the cows for a single userCommons. It is a public method only so it can be exposed to the unit tests- Parameters:
ctx- the JobContextcommons- the CommonsuserCommons- the UserCommons
-
calculateMilkingProfit
Calculate the profit for a user from milking their cows.- Parameters:
userCommons-- Returns:
-