diff options
| author | clarkohw <clark_oh-willeke@brown.edu> | 2021-04-19 03:01:48 -0400 |
|---|---|---|
| committer | clarkohw <clark_oh-willeke@brown.edu> | 2021-04-19 03:01:48 -0400 |
| commit | 0508b076ac948a11bde14cfa9f5261796d890ef2 (patch) | |
| tree | a22f1803b10093561283f5ce03135dab49e5b538 /src/main/java | |
| parent | 8e76bf15c53c540a72a273ec560a624dfb7e11df (diff) | |
caching of prices profit
Diffstat (limited to 'src/main/java')
| -rw-r--r-- | src/main/java/edu/brown/cs/student/term/profit/ProfitCalculation.java | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/main/java/edu/brown/cs/student/term/profit/ProfitCalculation.java b/src/main/java/edu/brown/cs/student/term/profit/ProfitCalculation.java index fe12612..77c1c3a 100644 --- a/src/main/java/edu/brown/cs/student/term/profit/ProfitCalculation.java +++ b/src/main/java/edu/brown/cs/student/term/profit/ProfitCalculation.java @@ -251,6 +251,7 @@ public class ProfitCalculation { JSONArray object = new JSONObject(response.body()).getJSONArray(ticker); try { double endPrice = object.getJSONObject(object.length() - 1).getDouble("c"); + currentStockPrices.put(ticker, endPrice); return endPrice; } catch (JSONException e) { currentStockPrices.put(ticker, -1.0); |
