Created
September 25, 2013 16:43
-
-
Save kevinpet/6702441 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
class Account { | |
private Strategy strategy; | |
private Map<String, Double> investments; | |
boolean addInvestment(String symbol, double fraction, double riskiness) { | |
if (strategy.isRiskAcceptable(fraction, riskiness)) { | |
investments.put(symbol, fraction); | |
return true; | |
} | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment