com.moneydance.apps.md.model
Class TransactionSet

java.lang.Object
  extended by com.moneydance.apps.md.model.TransactionSet

public class TransactionSet
extends java.lang.Object

The set of transactions that are associated with a data file or RootAccount


Constructor Summary
TransactionSet(RootAccount rootAccount)
           
 
Method Summary
 void addNewTxn(ParentTxn t)
          Add a new transaction to the transaction set.
 void addTransactionListener(TransactionListener listener)
          Register an object that would like to receive notification when transactions have been modified, added, or removed.
 void addTxnAgain(AbstractTxn txn)
          Adds a transaction and all of its splits back to the list without assigning them a unique transaction ID.
 ParentTxn findBestMatch(java.lang.String payee, long amount, Account acct)
          Find the most recent transaction that has the closest payee to the given value.
 java.util.Enumeration<AbstractTxn> getAllTransactions()
          Return an Enumeration containing all of the transactions
 TxnSet getAllTxns()
          Return a TxnSet containing all of the transactions
 DateRange getDateBounds()
           
 long getTransactionCount()
           
 TxnSet getTransactionsForAccount(Account acct)
          Get all of the transactions that are in the specified account
 AbstractTxn getTxnByID(long txnID)
           
 java.util.Vector<AbstractTxn> getTxnsForAllAccounts()
          Get all of the transactions in a copy of the current transaction list
 boolean hasTxnsForAccount(Account acct)
           
 boolean isDirty()
           
 void loadTxn(ParentTxn t)
          Add the specified transaction to the txn set.
 ParentTxn[] matchPayee(Account account, java.lang.String description, boolean caseSensitive, int numMatches)
          Return the most recently entered 'numMatches' transactions that match the given description.
 SplitTxn[] matchSplitPayee(Account account, java.lang.String description, boolean caseSensitive, int numMatches)
          Return the most recently entered 'numMatches' split transactions that match the given description.
 void removeTransactionListener(TransactionListener listener)
           
 void removeTxn(AbstractTxn txn)
          Remove the specified transaction.
 void resetDirtyFlags()
           
 void setDirty()
           
 void txnModified(AbstractTxn t)
          Record that the specified transaction has been modified, notifying all listeners that this txn and all of its splits have been modified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionSet

public TransactionSet(RootAccount rootAccount)
Method Detail

setDirty

public void setDirty()

isDirty

public boolean isDirty()

resetDirtyFlags

public void resetDirtyFlags()

loadTxn

public void loadTxn(ParentTxn t)
Add the specified transaction to the txn set. This should only be called when loading transactions into the set from a file or database. This should *NOT* be called by normal code to add a transaction.


addNewTxn

public void addNewTxn(ParentTxn t)
Add a new transaction to the transaction set. If this is a ParentTxn, all of it's associated SplitTxns are also added to the set.


addTxnAgain

public void addTxnAgain(AbstractTxn txn)
Adds a transaction and all of its splits back to the list without assigning them a unique transaction ID. This is used to undo delete transaction operations. This is only available as of build 600.


removeTxn

public void removeTxn(AbstractTxn txn)
Remove the specified transaction. This is new as of build 600. Before build 600 this only accepted a ParentTxn


txnModified

public void txnModified(AbstractTxn t)
Record that the specified transaction has been modified, notifying all listeners that this txn and all of its splits have been modified.


addTransactionListener

public void addTransactionListener(TransactionListener listener)
Register an object that would like to receive notification when transactions have been modified, added, or removed.


removeTransactionListener

public void removeTransactionListener(TransactionListener listener)

getAllTransactions

public java.util.Enumeration<AbstractTxn> getAllTransactions()
Return an Enumeration containing all of the transactions


getAllTxns

public TxnSet getAllTxns()
Return a TxnSet containing all of the transactions


getTransactionCount

public long getTransactionCount()

getDateBounds

public final DateRange getDateBounds()

findBestMatch

public ParentTxn findBestMatch(java.lang.String payee,
                               long amount,
                               Account acct)
Find the most recent transaction that has the closest payee to the given value. If no transactions are a close enough match, return null. This currently only scans parent transactions.


getTxnByID

public final AbstractTxn getTxnByID(long txnID)

getTxnsForAllAccounts

public final java.util.Vector<AbstractTxn> getTxnsForAllAccounts()
Get all of the transactions in a copy of the current transaction list


hasTxnsForAccount

public final boolean hasTxnsForAccount(Account acct)

getTransactionsForAccount

public TxnSet getTransactionsForAccount(Account acct)
Get all of the transactions that are in the specified account


matchSplitPayee

public SplitTxn[] matchSplitPayee(Account account,
                                  java.lang.String description,
                                  boolean caseSensitive,
                                  int numMatches)
Return the most recently entered 'numMatches' split transactions that match the given description. If the caseSensitive flag is true then the matching transactions must start with the exact string in description.


matchPayee

public ParentTxn[] matchPayee(Account account,
                              java.lang.String description,
                              boolean caseSensitive,
                              int numMatches)
Return the most recently entered 'numMatches' transactions that match the given description. If the caseSensitive flag is true then the matching transactions must start with the exact string in description.