Created
April 24, 2015 10:26
-
-
Save kmdupr33/b0e31bfca58e8acb9465 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MathNerd { | |
private final mCalcCache; | |
private final mCalculator; | |
public MathNerd(CalculationCache calcCache, Calculator calculator) { | |
mCalcCache = calcCache; | |
mCalculator = calculator; | |
} | |
public void doIntenseCalculation(Calculation calculation, IntenseCalculationCompletedListener listener) { | |
if (!mCalcCache.contains(calculation)) { | |
mCalculator.doIntenseCalculationInBackground(listener); | |
} else { | |
Answer answer = mCalcCache.getAnswerFor(calculation); | |
listener.onCalculationCompleted(answer); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Missing types of fields.