com.moneydance.apps.md.model
Class TxnSet

java.lang.Object
  extended by com.moneydance.apps.md.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
TxnSet()
           
TxnSet(AbstractTxn[] txnArray, int numTxns)
           
 
Method Summary
 void addTxn(AbstractTxn txn)
           
 TxnSet cloneTxns()
           
 boolean contains(AbstractTxn txn)
          Returns true if the given transaction is in this TxnSet.
 java.util.Enumeration<AbstractTxn> getAllTxns()
           
 long getBalanceAt(int i)
           
 DateRange getDateBounds()
          Return the date range that will just barely include all of the transactions in the set.
 AbstractTxn getLastTxn()
           
 int getSize()
           
 AbstractTxn getTxn(int i)
           
 AbstractTxn getTxnAt(int i)
           
 AbstractTxn getTxnByID(long txnID)
           
 java.util.Vector<AbstractTxn> getVector()
           
 boolean hasTxnsForAccount(Account acct)
           
 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 collection
 void removeAllTxns()
           
 boolean removeTxn(AbstractTxn txn)
           
 void removeTxnAt(int i)
           
 void setHoldBalances(boolean trackBalances)
           
 void setTxnAt(AbstractTxn txn, int index)
           
 void swap(int index1, int index2)
           
 AbstractTxn[] toArray()
          Return a copy of an array with all of the transactions in it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TxnSet

public TxnSet()

TxnSet

public TxnSet(AbstractTxn[] txnArray,
              int numTxns)
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)

recalcBalances

public final void recalcBalances(long startBalance,
                                 boolean negateBalances)

getTxnAt

public final AbstractTxn getTxnAt(int i)

getBalanceAt

public final long getBalanceAt(int i)

getTxn

public AbstractTxn getTxn(int i)

getTxnByID

public AbstractTxn getTxnByID(long txnID)

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()

hasTxnsForAccount

public final boolean hasTxnsForAccount(Account acct)

getDateBounds

public final DateRange getDateBounds()
Return the date range that will just barely include all of the transactions in the set.


iterator

public java.util.Iterator<AbstractTxn> iterator()
Returns an iterator over the transaction in this set, in reverse order. Note that Iterator.remove() is not supported by this iterator.

Specified by:
iterator in interface java.lang.Iterable<AbstractTxn>
Since:
build 736

getAllTxns

public final java.util.Enumeration<AbstractTxn> getAllTxns()
Returns:
Enumerator of all transactions in the set, in reverse order.

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.


getVector

public final java.util.Vector<AbstractTxn> getVector()