Skip to content

Instantly share code, notes, and snippets.

@kmdupr33
Created April 24, 2015 10:26
Show Gist options
  • Save kmdupr33/b0e31bfca58e8acb9465 to your computer and use it in GitHub Desktop.
Save kmdupr33/b0e31bfca58e8acb9465 to your computer and use it in GitHub Desktop.
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);
}
}
}
@TWiStErRob
Copy link

Missing types of fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment