com.moneydance.apps.md.model
Class TxnTagSet

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

public class TxnTagSet
extends java.lang.Object

A TxnTagSet keeps track of the set of TxnTags that are associated with an AbstractTxn. This class is only available as of build 414


Field Summary
static java.lang.String TAG_PARAM_PREFIX
           
static java.lang.String TXN_TAG_KEY
           
 
Method Summary
 void addListener(TxnTagListener listener)
          Register an object that would like to receive notification when transaction tags are added, removed or modified
 java.util.Iterator getAllTags()
          Return an interator over the set of TxnTags
static java.lang.String getIDStringForTags(TxnTag[] tags)
          Get the tagset string that identifies the tags in the given array
 int getNumTags()
          Return the number of tags in the set
 TxnTag[] getSortedTags()
          Return a list of the tags in sorted order
 TxnTag[] getTagsForIDString(java.lang.String tagStr)
          Get the tags that identified in the given tagset string.
 TxnTag[] getTagsForTxn(AbstractTxn txn)
          Get the tags that are associated with the given transaction.
 TxnTag[] getTagsForTxn(Txn txn)
          Get the tags that are associated with the given transaction.
 java.lang.String getTagStringForTxn(AbstractTxn txn)
          Return a string representing all of the tags associated with the given transaction
 TxnTag makeNewTag(java.lang.String tagName)
          Construct a new TxnTag with the given name, and add it to the set.
 void removeListener(TxnTagListener listener)
          De-register an object that would no longer like to receive notification when transaction tags are added, removed or modified
 boolean removeTag(TxnTag tag)
          Remove the given tag from the tag set if there are no transactions referencing the tag.
static void setTagsForTxn(AbstractTxn txn, TxnTag[] tags)
          Associate the given set of tags with the given transaction
 void sortTagArray(TxnTag[] tagArray)
           
static boolean txnContainsTag(AbstractTxn txn, TxnTag tag)
           
static boolean txnContainsTag(Txn txn, TxnTag tag)
          Returns true iff the given tag has been assigned to the given transaction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TAG_PARAM_PREFIX

public static final java.lang.String TAG_PARAM_PREFIX
See Also:
Constant Field Values

TXN_TAG_KEY

public static final java.lang.String TXN_TAG_KEY
See Also:
Constant Field Values
Method Detail

getNumTags

public int getNumTags()
Return the number of tags in the set


addListener

public void addListener(TxnTagListener listener)
Register an object that would like to receive notification when transaction tags are added, removed or modified


removeListener

public void removeListener(TxnTagListener listener)
De-register an object that would no longer like to receive notification when transaction tags are added, removed or modified


getAllTags

public java.util.Iterator getAllTags()
Return an interator over the set of TxnTags


getSortedTags

public TxnTag[] getSortedTags()
Return a list of the tags in sorted order


sortTagArray

public void sortTagArray(TxnTag[] tagArray)

removeTag

public boolean removeTag(TxnTag tag)
Remove the given tag from the tag set if there are no transactions referencing the tag. Returns true if the tag was able to be removed.


makeNewTag

public TxnTag makeNewTag(java.lang.String tagName)
Construct a new TxnTag with the given name, and add it to the set.


setTagsForTxn

public static final void setTagsForTxn(AbstractTxn txn,
                                       TxnTag[] tags)
Associate the given set of tags with the given transaction


getIDStringForTags

public static final java.lang.String getIDStringForTags(TxnTag[] tags)
Get the tagset string that identifies the tags in the given array


txnContainsTag

public static final boolean txnContainsTag(Txn txn,
                                           TxnTag tag)
Returns true iff the given tag has been assigned to the given transaction


txnContainsTag

public static boolean txnContainsTag(AbstractTxn txn,
                                     TxnTag tag)
Returns:
True iff the given tag has been assigned to the given transaction

getTagsForTxn

public final TxnTag[] getTagsForTxn(AbstractTxn txn)
Get the tags that are associated with the given transaction. This will never return null.


getTagsForTxn

public final TxnTag[] getTagsForTxn(Txn txn)
Get the tags that are associated with the given transaction. This will never return null.


getTagStringForTxn

public final java.lang.String getTagStringForTxn(AbstractTxn txn)
Return a string representing all of the tags associated with the given transaction

Since:
build 610

getTagsForIDString

public final TxnTag[] getTagsForIDString(java.lang.String tagStr)
Get the tags that identified in the given tagset string.