there's onle one header, and having a stable Id avoids visual flicker
when the list is updated
static abstract class Item {
private static int idDispenser = 0;
static abstract class Item {
private static int idDispenser = 0;
+ protected final int id;
- synchronized (Item.class) {
- id = ++idDispenser;
- }
+ if (this instanceof TransactionHead)
+ id = 0;
+ else
+ synchronized (Item.class) {
+ id = ++idDispenser;
+ }
+ }
+ public Item(int id) {
+ this.id = id;
}
public static Item from(Item origin) {
if (origin instanceof TransactionHead)
}
public static Item from(Item origin) {
if (origin instanceof TransactionHead)
this.description = description;
}
public TransactionHead(TransactionHead origin) {
this.description = description;
}
public TransactionHead(TransactionHead origin) {
date = origin.date;
description = origin.description;
comment = origin.comment;
date = origin.date;
description = origin.description;
comment = origin.comment;
private boolean isLast = false;
private int accountNameCursorPosition;
public TransactionAccount(TransactionAccount origin) {
private boolean isLast = false;
private int accountNameCursorPosition;
public TransactionAccount(TransactionAccount origin) {
accountName = origin.accountName;
amount = origin.amount;
amountSet = origin.amountSet;
accountName = origin.accountName;
amount = origin.amount;
amountSet = origin.amountSet;