Skip to content

Instantly share code, notes, and snippets.

@kevinpet
Created September 25, 2013 16:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinpet/6702441 to your computer and use it in GitHub Desktop.
Save kevinpet/6702441 to your computer and use it in GitHub Desktop.
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