]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/json/v1_14/ParsedLedgerAccount.java
more pronounced day/month delimiters in the transaction list
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / json / v1_14 / ParsedLedgerAccount.java
index 308140092b6eba78e80b00b072cbb434348c5767..476e9cd713936c8c3474151b5b2e00216ac87424 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2019 Damyan Ivanov.
+ * Copyright © 2020 Damyan Ivanov.
  * This file is part of MoLe.
  * MoLe is free software: you can distribute it and/or modify it
  * under the term of the GNU General Public License as published by
@@ -19,39 +19,35 @@ package net.ktnx.mobileledger.json.v1_14;
 
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 
+import java.util.ArrayList;
 import java.util.List;
 
 @JsonIgnoreProperties(ignoreUnknown = true)
-public class ParsedLedgerAccount {
+public class ParsedLedgerAccount extends net.ktnx.mobileledger.json.ParsedLedgerAccount {
     private List<ParsedBalance> aebalance;
     private List<ParsedBalance> aibalance;
-    private String aname;
-    private int anumpostings;
     public ParsedLedgerAccount() {
     }
-    public int getAnumpostings() {
-        return anumpostings;
-    }
-    public void setAnumpostings(int anumpostings) {
-        this.anumpostings = anumpostings;
-    }
     public List<ParsedBalance> getAebalance() {
         return aebalance;
     }
-    public List<ParsedBalance> getAibalance() {
-        return aibalance;
-    }
     public void setAebalance(List<ParsedBalance> aebalance) {
         this.aebalance = aebalance;
     }
+    public List<ParsedBalance> getAibalance() {
+        return aibalance;
+    }
     public void setAibalance(List<ParsedBalance> aibalance) {
         this.aibalance = aibalance;
     }
-    public String getAname() {
-        return aname;
-    }
-    public void setAname(String aname) {
-        this.aname = aname;
-    }
+    @Override
+    public List<SimpleBalance> getSimpleBalance() {
+        List<SimpleBalance> result = new ArrayList<SimpleBalance>();
+        for (ParsedBalance b : getAibalance()) {
+            result.add(new SimpleBalance(b.getAcommodity(), b.getAquantity()
+                                                             .asFloat()));
+        }
 
+        return result;
+    }
 }