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
Modifier and Type Method Description voidaddAll(java.util.Collection<AbstractTxn> txnList)voidaddTxn(AbstractTxn txn)TxnSetcloneTxns()booleancontains(AbstractTxn txn)Returns true if the given transaction is in this TxnSet.voidcopyInto(TxnSet txnSet)voidcopyInto(java.util.List<AbstractTxn> txnList)voidcopyInto(java.util.Set<AbstractTxn> txnList)longgetBalanceAt(int i)AbstractTxngetLastTxn()intgetSize()AbstractTxngetTxn(int i)AbstractTxngetTxnAt(int i)AbstractTxngetTxnByID(java.lang.String uuid)AbstractTxngetTxnByLegacyID(long txnID)intindexOf(AbstractTxn txn)voidinsertTxnAt(AbstractTxn txn, int index)java.util.Iterator<AbstractTxn>iterator()Returns an iterator over the transaction in this set, in reverse order.voidrecalcBalances(long startBalance, boolean negateBalances)voidrecalcBalances(long startBalance, boolean negateBalances, boolean reverseOrder)voidremoveAll(java.util.Collection<AbstractTxn> c)Remove all objects that are in the given collectionvoidremoveAllTxns()booleanremoveTxn(AbstractTxn txn)voidremoveTxnAt(int i)voidsetHoldBalances(boolean trackBalances)voidsetTxnAt(AbstractTxn txn, int index)voidsortByField(int sortField)Sort the transactions in this TxnSet by the given field (defined as ints in AccountUtil)voidsortWithComparator(java.util.Comparator<AbstractTxn> comparator)Sort the transactions in this TxnSet using the given comparator.voidswap(int index1, int index2)AbstractTxn[]toArray()Return a copy of an array with all of the transactions in it.
-
Constructor Details
-
Method Details
-
removeAll
Remove all objects that are in the given collection- Since:
- build 736
-
removeAllTxns
public void removeAllTxns() -
setHoldBalances
public void setHoldBalances(boolean trackBalances) -
copyInto
-
copyInto
-
copyInto
-
addAll
-
recalcBalances
public final void recalcBalances(long startBalance, boolean negateBalances) -
recalcBalances
public final void recalcBalances(long startBalance, boolean negateBalances, boolean reverseOrder) -
getTxnAt
-
getTxnByLegacyID
-
getTxnByID
-
getBalanceAt
public final long getBalanceAt(int i) -
getTxn
-
getLastTxn
-
indexOf
-
addTxn
-
setTxnAt
-
insertTxnAt
-
contains
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
-
swap
public final void swap(int index1, int index2) -
getSize
public final int getSize() -
iterator
Returns an iterator over the transaction in this set, in reverse order. Note thatIterator.remove()is not supported by this iterator.- Specified by:
iteratorin interfacejava.lang.Iterable<AbstractTxn>- Since:
- build 736
-
cloneTxns
-
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
Sort the transactions in this TxnSet using the given comparator. A set of transaction comparators are available in the TxnUtil class.- Since:
- build 1190
-