]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/model/LedgerTransactionItem.java
whitespace
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / model / LedgerTransactionItem.java
index ff19a450251aef1077855d2862f21502cb42c0e8..de43058067f193216674c1f09634db7f2f958331 100644 (file)
@@ -40,14 +40,18 @@ public class LedgerTransactionItem {
     public String getAccountName() {
         return accountName;
     }
+    public String getShortAccountName() {
+        String result = accountName;
+        result = result.replaceAll("(?<=^|:)(.)[^:]+(?=:)", "$1");
+        return result;
+    }
 
     public void setAccountName(String accountName) {
         this.accountName = accountName;
     }
 
     public float getAmount() {
-        if (!amountSet)
-            throw new IllegalStateException("Account amount is not set");
+        if (!amountSet) throw new IllegalStateException("Account amount is not set");
 
         return amount;
     }