Skip to content

Commit

Permalink
Revert "Improve moneyLog access"
Browse files Browse the repository at this point in the history
This reverts commit 6a8fbf1.
  • Loading branch information
marecabo committed Apr 30, 2024
1 parent f6c8a41 commit bb1263a
Show file tree
Hide file tree
Showing 2 changed files with 1,407 additions and 1,428 deletions.
6 changes: 0 additions & 6 deletions src/main/java/com/arup/cml/abm/kpi/data/MoneyLog.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.arup.cml.abm.kpi.data;

import java.util.*;
import java.util.Map.Entry;

public class MoneyLog {

Expand All @@ -15,11 +14,6 @@ public Map<Double, Double> getMoneyLogData(String personID) {
return getPersonLog(personID);
}

public double getMoneyLogData(String personID, double departureTime, double arrivalTime) {
return getPersonLog(personID).entrySet().stream()
.filter(e -> e.getKey() > departureTime && e.getKey() <= arrivalTime).mapToDouble(Entry::getValue).sum();
}

public void createMoneyLogEntry(String personID, double time, double amount) {
Map<Double, Double> personLog = getPersonLog(personID);
personLog.compute(time, (k, v) -> (v == null) ? amount : amount + v);
Expand Down
Loading

0 comments on commit bb1263a

Please sign in to comment.