+ enum FocusedElement {Account, Comment, Amount}
+
+ private class ItemsForCurrency {
+ private HashMap<String, List<Item>> hashMap = new HashMap<>();
+ @NonNull
+ List<Item> getList(@Nullable String currencyName) {
+ List<Item> list = hashMap.get(currencyName);
+ if (list == null) {
+ list = new ArrayList<>();
+ hashMap.put(currencyName, list);
+ }
+ return list;
+ }
+ void add(@Nullable String currencyName, @NonNull Item item) {
+ getList(currencyName).add(item);
+ }
+ int size(@Nullable String currencyName) {
+ return this.getList(currencyName)
+ .size();
+ }
+ Set<String> currencies() {
+ return hashMap.keySet();
+ }
+ }
+