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 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
recalcBalances(long startBalance, boolean negateBalances, boolean reverseOrder)
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 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:
iterator
in 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
-