X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fmodel%2FCurrency.java;h=1c7dbf7f81f014062c1282d55d2f9633d47abe9b;hb=1fd204fbd59c59032c67d8451b28307a2bf89e2f;hp=f332f001667cf1e83cff65571271dcb141847c2c;hpb=20c03b7a5eb152d42fbbe9ecbaae27530563b398;p=mobile-ledger.git diff --git a/app/src/main/java/net/ktnx/mobileledger/model/Currency.java b/app/src/main/java/net/ktnx/mobileledger/model/Currency.java index f332f001..1c7dbf7f 100644 --- a/app/src/main/java/net/ktnx/mobileledger/model/Currency.java +++ b/app/src/main/java/net/ktnx/mobileledger/model/Currency.java @@ -76,6 +76,10 @@ public class Currency { MobileLedgerProfile profile = Data.getProfile(); return profile.loadCurrencyByName(name); } + public static Currency loadById(int id) { + MobileLedgerProfile profile = Data.getProfile(); + return profile.loadCurrencyById(id); + } static public boolean equal(Currency left, Currency right) { if (left == null) { return right == null; @@ -119,22 +123,6 @@ public class Currency { this.hasGap = hasGap; } public enum Position { - before(-1), after(1), unknown(0), none(-2); - Position(int value) { - } - static Position valueOf(int value) { - switch (value) { - case -1: - return before; - case +1: - return after; - case 0: - return unknown; - case -2: - return none; - default: - throw new IllegalStateException(String.format("Unexpected value (%d)", value)); - } - } + before, after, unknown, none } }