Class TxnSet
- java.lang.Object
-
- com.infinitekind.moneydance.model.TxnSet
-
- All Implemented Interfaces:
java.lang.Iterable<AbstractTxn>
public class TxnSet extends java.lang.Object implements java.lang.Iterable<AbstractTxn>
An unsynchronized (unlike Vector) storage for AbstractTxn objects.
-
-
Constructor Summary
Constructors Constructor Description TxnSet()
TxnSet(java.util.Collection<AbstractTxn> txnList)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAll(java.util.Collection<AbstractTxn> txnList)
void
addTxn(AbstractTxn txn)
TxnSet
cloneTxns()
boolean
contains(AbstractTxn txn)
Returns true if the given transaction is in this TxnSet.void
copyInto(TxnSet txnSet)
void
copyInto(java.util.List<AbstractTxn> txnList)
void
copyInto(java.util.Set<AbstractTxn> txnList)
long
getBalanceAt(int i)
AbstractTxn
getLastTxn()
int
getSize()
AbstractTxn
getTxn(int i)
AbstractTxn
getTxnAt(int i)
AbstractTxn
getTxnByID(java.lang.String uuid)
AbstractTxn
getTxnByLegacyID(long txnID)
int
indexOf(AbstractTxn txn)
void
insertTxnAt(AbstractTxn txn, int index)
java.util.Iterator<AbstractTxn>
iterator()
Returns an iterator over the transaction in this set, in reverse order.void
recalcBalances(long startBalance, boolean negateBalances)
void
removeAll(java.util.Collection<AbstractTxn> c)
Remove all objects that are in the given collectionvoid
removeAllTxns()
boolean
removeTxn(AbstractTxn txn)
void
removeTxnAt(int i)
void
setHoldBalances(boolean trackBalances)
void
setTxnAt(AbstractTxn txn, int index)
void
sortByField(int sortField)
Sort the transactions in this TxnSet by the given field (defined as ints in AccountUtil)void
sortWithComparator(java.util.Comparator<AbstractTxn> comparator)
Sort the transactions in this TxnSet using the given comparator.void
swap(int index1, int index2)
AbstractTxn[]
toArray()
Return a copy of an array with all of the transactions in it.
-
-
-
Constructor Detail
-
TxnSet
public TxnSet()
-
TxnSet
public TxnSet(java.util.Collection<AbstractTxn> txnList)
-
-
Method Detail
-
removeAll
public void removeAll(java.util.Collection<AbstractTxn> c)
Remove all objects that are in the given collection- Since:
- build 736
-
removeAllTxns
public void removeAllTxns()
-
setHoldBalances
public void setHoldBalances(boolean trackBalances)
-
copyInto
public void copyInto(java.util.List<AbstractTxn> txnList)
-
copyInto
public void copyInto(java.util.Set<AbstractTxn> txnList)
-
copyInto
public void copyInto(TxnSet txnSet)
-
addAll
public void addAll(java.util.Collection<AbstractTxn> txnList)
-
recalcBalances
public final void recalcBalances(long startBalance, boolean negateBalances)
-
getTxnAt
public final AbstractTxn getTxnAt(int i)
-
getTxnByLegacyID
public AbstractTxn getTxnByLegacyID(long txnID)
-
getTxnByID
public AbstractTxn getTxnByID(java.lang.String uuid)
-
getBalanceAt
public final long getBalanceAt(int i)
-
getTxn
public AbstractTxn getTxn(int i)
-
getLastTxn
public AbstractTxn getLastTxn()
-
indexOf
public final int indexOf(AbstractTxn txn)
-
addTxn
public final void addTxn(AbstractTxn txn)
-
setTxnAt
public final void setTxnAt(AbstractTxn txn, int index)
-
insertTxnAt
public final void insertTxnAt(AbstractTxn txn, int index)
-
contains
public final boolean contains(AbstractTxn txn)
Returns true if the given transaction is in this TxnSet. Note: this is only available as of build 273.
-
removeTxnAt
public final void removeTxnAt(int i)
-
removeTxn
public final boolean removeTxn(AbstractTxn txn)
-
swap
public final void swap(int index1, int index2)
-
getSize
public final int getSize()
-
iterator
public java.util.Iterator<AbstractTxn> iterator()
Returns an iterator over the transaction in this set, in reverse order. Note thatIterator.remove()
is not supported by this iterator.- Specified by:
iterator
in interfacejava.lang.Iterable<AbstractTxn>
- Since:
- build 736
-
cloneTxns
public final TxnSet cloneTxns()
-
toArray
public final AbstractTxn[] toArray()
Return a copy of an array with all of the transactions in it. Note: this is only available as of build 273.
-
sortByField
public void sortByField(int sortField)
Sort the transactions in this TxnSet by the given field (defined as ints in AccountUtil)- Since:
- build 1190
-
sortWithComparator
public void sortWithComparator(java.util.Comparator<AbstractTxn> comparator)
Sort the transactions in this TxnSet using the given comparator. A set of transaction comparators are available in the TxnUtil class.- Since:
- build 1190
-
-