]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/model/LedgerAccount.java
running totals when filtering transactions by account
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / model / LedgerAccount.java
index 06ac4da110f61acb3a73c1309f3da1332a88f671..1be684cf1b0d1bcb700485384a3a068963576610 100644 (file)
@@ -58,6 +58,9 @@ public class LedgerAccount {
         else
             return accName.substring(0, colonPos);
     }
+    public static boolean isParentOf(@NonNull String possibleParent, @NonNull String accountName) {
+        return accountName.startsWith(possibleParent + ':');
+    }
     @NonNull
     static public LedgerAccount fromDBO(AccountWithAmounts in, LedgerAccount parent) {
         LedgerAccount res = new LedgerAccount(in.account.getName(), parent);