com.moneydance.apps.md.model
Class Account

java.lang.Object
  extended by com.moneydance.apps.md.model.Account
Direct Known Subclasses:
AssetAccount, BankAccount, CreditCardAccount, ExpenseAccount, IncomeAccount, InvestmentAccount, LiabilityAccount, LoanAccount, RootAccount, SecurityAccount

public abstract class Account
extends java.lang.Object

The base account class. All types of accounts will subclass this object. This object maintains a list of sub-accounts, as well as the standard attributes associated with an account (name, type, currency, start balance, etc)


Field Summary
static int ACCOUNT_TYPE_ASSET
           
static int ACCOUNT_TYPE_BANK
           
static int ACCOUNT_TYPE_CREDIT_CARD
           
static int ACCOUNT_TYPE_EXPENSE
           
static int ACCOUNT_TYPE_INCOME
           
static int ACCOUNT_TYPE_INVESTMENT
           
static int ACCOUNT_TYPE_LIABILITY
           
static int ACCOUNT_TYPE_LOAN
           
static int ACCOUNT_TYPE_ROOT
           
static int ACCOUNT_TYPE_SECURITY
           
static java.lang.String BUDGET_CLASS_DISCRETIONARY
           
static java.lang.String BUDGET_CLASS_INCOME
           
static java.lang.String BUDGET_CLASS_MISC
           
static java.lang.String BUDGET_CLASS_REQUIRED
           
static java.lang.String BUDGET_INTERVAL_MONTHLY
           
static java.lang.String BUDGET_INTERVAL_QUARTERLY
           
static java.lang.String BUDGET_INTERVAL_WEEKLY
           
static java.lang.String BUDGET_INTERVAL_YEARLY
           
static int MAX_BUDGETS
           
protected  boolean negate
           
static java.lang.String PARAM_QIF_TXNID
           
static java.lang.String PARAM_VAT_ACCT
           
static java.lang.String PARAM_VAT_APPLIES
           
static java.lang.String PARAM_VAT_PCT
           
static int SPLIT_ACCOUNT_ID
           
 
Constructor Summary
Account(java.lang.String acctName, int acctNum, int accountType, CurrencyType currency, java.util.Hashtable params, java.util.Vector subAccts, Account parentAcct, long startBalance)
           
 
Method Summary
protected  Account _getAccountByName(java.lang.String name)
           
protected  Account _getAccountByName(java.lang.String name, int accountType)
           
protected  void _removeSubAccount(Account acct)
          Removes the given sub-account from this account.
 void addAccountListener(AccountListener listener)
          add a listener to be notified when this account is modified.
 void addSubAccount(Account acct)
           
 void adjustStartBalance(long adjustAmount)
          Adjust the starting balance by the given amount.
 boolean balanceIsNegated()
          Get the starting balance for this account
 void billpayTxnsUpdated()
           
 java.util.Hashtable cloneParameters()
           
 void downloadedTxnsUpdated()
           
 void dumpAccounts()
           
 void ensureHasSubAccount(Account acct)
          Make sure that the specified account is in the list of children for this account.
 Account getAccountByName(java.lang.String name)
           
 Account getAccountByName(java.lang.String name, int accountType)
           
 java.lang.String getAccountName()
           
 int getAccountNum()
           
 int getAccountType()
           
 java.lang.String[] getAllAccountNames()
          Get an array of the account names between the root account and this account.
 long getBalance()
           
 OnlineService getBankingFI()
          Get the OFX connection information use for online banking in this account, if any.
 OnlineService getBillPayFI()
          Get the OFX connection information use for online bill-payment in this account, if any.
 OnlineTxnList getBillpayTxns()
           
 boolean getBooleanParameter(java.lang.String parameterName, boolean defaultVal)
          Get the specified parameter as a boolean.
 long getBudgetAmount(int budgetNum)
          Get the amount that is budgeted for this account, given the budget number.
 java.lang.String getBudgetClass(int budgetNum)
          Get the class (misc, required, discretionary, etc) for the given budget
 java.lang.String getBudgetInterval(int budgetNum)
          Get the interval (monthly, weekly, quarterly, etc) for the given budget
 java.lang.String[] getCheckNumTags(java.lang.String deflt)
           
 long getClearedBalance()
           
 java.lang.String getComment()
           
 long getCreationDate()
          Gets the date that this account was opened/created (this method only available as of build 253)
 int getCreationDateInt()
          Gets the date that this account was opened/created encoded as an int.
 CurrencyType getCurrencyType()
           
 long getCurrentBalance()
           
 Account getDefaultCategory()
           
 int getDepth()
          Get this accounts depth in the account tree.
 double getDoubleParameter(java.lang.String parameterName, double defaultVal)
          Get the specified parameter as an integer.
 OnlineTxnList getDownloadedTxns()
          Get the current list of downloaded transactions for this
 java.lang.String getFullAccountName()
           
 boolean getHideOnHomePage()
           
 int getHighestAccountNum()
          Get the highest account (ID) number.
 java.lang.String getIndentedName()
           
 int getIntParameter(java.lang.String parameterName, int defaultVal)
          Get the specified parameter as an integer.
 long getLongParameter(java.lang.String parameterName, long defaultVal)
          Get the specified parameter as a long.
 int getNextCheckNumber()
           
 java.lang.String getOFXAccountKey()
           
 java.lang.String getOFXAccountNumber()
           
 java.lang.String getOFXAccountType()
           
 java.lang.String getOFXBankID()
          Bank ID: used or not according to country: BEL Bank code CAN Routing and transit number CHE Clearing number DEU Bankleitzah ESP Entidad FRA Banque GBR Sort code ITA ABI NLD Not used (field contents ignored) USA Routing and transit number
 java.lang.String getOFXBranchID()
           
 java.lang.String getOFXBrokerID()
           
 long getOFXLastTxnUpdate()
           
 long getOnlineAvailBalance()
          Returns the available balance that was acquired from an online source, or zero if no balance was acquired.
 long getOnlineAvailBalanceDate()
          Returns the 'as of' date for the available balance that was acquired from an online source, or zero if no balance was acquired.
 long getOnlineLedgerBalance()
          Returns the ledger balance that was acquired from an online source, or zero if no balance was acquired.
 long getOnlineLedgerBalanceDate()
          Returns the 'as of' date for the ledger balance that was acquired from an online source, or zero if no balance was acquired.
 java.lang.String getParameter(java.lang.String parameterName)
           
 java.lang.String getParameter(java.lang.String parameterName, java.lang.String defaultStr)
          Get the specified parameter name.
 int getParameterCount()
          Get an enumeration of the keys of this accounts parameters
 java.util.Enumeration getParameterKeys()
           
 Account getParentAccount()
           
 Account[] getPath()
          Get an array of the accounts leading up to this account, starting at the RootAccount.
 boolean getPreferredSortAscending(boolean defaultVal)
           
 int getPreferredSortOrder(int defaultOrder)
           
 boolean getPreferredTwoLines(boolean defaultVal)
           
 long getReconcilingBalance()
           
 long getRecursiveBalance()
          Gets the balance for this account and all sub-accounts, converting the currencies of the sub-accounts at the current exchange rate.
 long getRecursiveClearedBalance()
          Gets the cleared balance for this account and all sub-accounts, converting the currencies of the sub-accounts at the current exchange rate.
 long getRecursiveCurrentBalance()
          Gets the current balance for this account and all sub-accounts, converting the currencies of the sub-accounts at the current exchange rate.
 long getRecursiveReconcilingBalance()
          Gets the reconciling balance for this account and all sub-accounts, converting the currencies of the sub-accounts at the current exchange rate.
 long getRecursiveStartBalance()
          Gets the starting balance for this account and all sub-accounts, converting the currencies of the sub-accounts at the appropriate exchange rate.
 long getRecursiveUserBalance()
          Gets the balance for this account and all sub-accounts, converting the currencies of the sub-accounts at the appropriate exchange rate.
 long getRecursiveUserClearedBalance()
          Gets the cleared balance for this account and all sub-accounts, converting the currencies of the sub-accounts at the appropriate exchange rate.
 long getRecursiveUserCurrentBalance()
          Gets the current balance for this account and all sub-accounts, converting the currencies of the sub-accounts at the appropriate exchange rate.
 long getRecursiveUserReconcilingBalance()
          Gets the reconciling balance for this account and all sub-accounts, converting the currencies of the sub-accounts at the appropriate exchange rate.
 long getRecursiveUserStartBalance()
          Gets the starting balance for this account and all sub-accounts, converting the currencies of the sub-accounts at the appropriate exchange rate.
 RootAccount getRootAccount()
           
 long getStartBalance()
           
 Account getSubAccount(int i)
           
 int getSubAccountCount()
          Get the number of sub-accounts in this account.
 java.util.Enumeration getSubAccounts()
           
 java.lang.String getTaxCategory()
          Get the identifier that indicates which (if any) tax category this account is associated with.
 long getUserBalance()
           
 long getUserClearedBalance()
           
 long getUserCurrentBalance()
           
 long getUserReconcilingBalance()
           
 long getUserStartBalance()
           
 boolean hasOnlineAvailBalance()
          Returns the available balance that was acquired from an online source, or zero if no balance was acquired.
 boolean hasOnlineLedgerBalance()
          Returns the ledger balance that was acquired from an online source, or zero if no balance was acquired.
 int indexOf(Account acct)
           
 boolean isAncestorOf(Account acct)
          Returns true if the given account is equal to this account or if it is a direct or indirect sub-account of this account.
 boolean isDescendantOf(Account acct)
           
 boolean isDirty()
          Returns true if there has been changes to this account or any child accounts that hasn't been saved.
 boolean isLeafNode()
           
 boolean isOnlineBankingCandidate()
          Returns true if it is possible to online-enable this account.
 boolean isOnlineBillpayCandidate()
          Returns true if it is possible to online-enable this account.
 boolean isOnlineEnabled()
          Returns true if this account is configured for online access.
 boolean isRegisterAccount()
           
static Account makeAccount(int acctType, java.lang.String name, CurrencyType currency, Account parent)
           
protected  void notifyAccountAdded(Account parent, Account newAccount)
          notify all listeners that the specified account has been added.
protected  void notifyAccountDeleted(Account parent, Account deletedAcct)
          notify all listeners that the specified account has been deleted.
protected  void notifyAccountModified(Account acct)
          notify all listeners that the specified account has been modified.
protected  void notifyBalanceChanged(Account acct)
          notify all listeners that a balance in the specified account has changed.
 void removeAccountListener(AccountListener listener)
          remove the specified object so that it doesn't get any more notifications when the account is modified.
 void removeParameter(java.lang.String parameterName)
          Remove the parameter with the given name.
 void removeSubAccount(Account acct, boolean recursive)
          Caution!! This can leave "orphan" transactions if an account that contains transactions is deleted.
protected  void resetDirtyFlags()
          set the dirty flag for this account and all sub-accounts to a non-dirty state.
 void setAccountName(java.lang.String newAccountName)
           
 void setBankingFI(OnlineService service)
          Set the online banking connection information used for online banking (transaction download, etc) in this account.
 void setBillPayFI(OnlineService service)
          Set the online banking connection information used for online banking (transaction download, etc) in this account.
 void setBudgetAmount(int budgetNum, long amount)
          Set the amount that is budgeted for this account, given the budget number and the amount.
 void setBudgetClass(int budgetNum, java.lang.String classID)
          Get the class (misc, required, discretionary, etc) for the given budget
 void setBudgetInterval(int budgetNum, java.lang.String intervalID)
          Set the interval (monthly, weekly, quarterly, etc) for the given budget
 void setCheckNumTags(java.lang.String[] checkTags)
           
 void setComment(java.lang.String comment)
           
 void setCreationDate(long date)
          Sets the date that this account was opened.
 void setCurrencyType(CurrencyType newCurrencyType)
          set the currency type.
 void setDefaultCategory(Account acct)
           
 void setDirtyFlag()
          set the dirty flag for this account.
 void setHideOnHomePage(boolean hide)
           
 void setOFXAccountKey(java.lang.String str)
           
 void setOFXAccountNumber(java.lang.String str)
           
 void setOFXAccountType(java.lang.String str)
           
 void setOFXBankID(java.lang.String bankId)
           
 void setOFXBranchID(java.lang.String branchId)
           
 void setOFXBrokerID(java.lang.String brokerId)
           
 void setOFXLastTxnUpdate(long date)
           
 void setOnlineAvailBalance(long onlineBalance, long asOfDate)
          Sets the available balance that was acquired from an online source.
 void setOnlineLedgerBalance(long onlineBalance, long asOfDate)
          Sets the ledger balance that was acquired from an online source.
 void setParameter(java.lang.String parameterName, boolean parameterValue)
          Set the given parameter name to the given boolean value
 void setParameter(java.lang.String parameterName, double parameterValue)
          Set the given parameter name to the given double value
 void setParameter(java.lang.String parameterName, int parameterValue)
          Set the given parameter name to the given integer value
 void setParameter(java.lang.String parameterName, long parameterValue)
          Set the given parameter name to the given long value
 void setParameter(java.lang.String parameterName, java.lang.String parameterValue)
          Set the given parameter name to the given value
 void setParameterNoNotify(java.lang.String parameterName, java.lang.String parameterValue)
          Set the given parameter name to the given value but don't notify listeners of changes!
 void setParentAccount(Account newParentAccount)
           
 void setPreference(java.lang.String parameterName, boolean parameterValue)
          Set the given parameter name to the given boolean value, without sending an account-changed event, or recording the account as dirty.
 void setPreference(java.lang.String parameterName, int parameterValue)
          Set the given parameter name to the given integer value, without sending an account-changed event, or recording the account as dirty.
 void setPreference(java.lang.String parameterName, java.lang.String parameterValue)
          Set the given preference name to the given value.
 void setPreferredSortAscending(boolean ascending)
           
 void setPreferredSortOrder(int newSortOrder)
           
 void setPreferredTwoLines(boolean twoLines)
           
 void setStartBalance(long newStartBalance)
          Set the initial balance of this account.
 void setTaxCategory(java.lang.String taxCategory)
          Set an identifier that indicates which (if any) tax category this account is associated with.
 void setUserStartBalance(long newStartBalance)
          Set the initial balance of this account.
 void sortAccounts()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SPLIT_ACCOUNT_ID

public static final int SPLIT_ACCOUNT_ID
See Also:
Constant Field Values

ACCOUNT_TYPE_ROOT

public static final int ACCOUNT_TYPE_ROOT
See Also:
Constant Field Values

ACCOUNT_TYPE_BANK

public static final int ACCOUNT_TYPE_BANK
See Also:
Constant Field Values

ACCOUNT_TYPE_CREDIT_CARD

public static final int ACCOUNT_TYPE_CREDIT_CARD
See Also:
Constant Field Values

ACCOUNT_TYPE_INVESTMENT

public static final int ACCOUNT_TYPE_INVESTMENT
See Also:
Constant Field Values

ACCOUNT_TYPE_SECURITY

public static final int ACCOUNT_TYPE_SECURITY
See Also:
Constant Field Values

ACCOUNT_TYPE_ASSET

public static final int ACCOUNT_TYPE_ASSET
See Also:
Constant Field Values

ACCOUNT_TYPE_LIABILITY

public static final int ACCOUNT_TYPE_LIABILITY
See Also:
Constant Field Values

ACCOUNT_TYPE_LOAN

public static final int ACCOUNT_TYPE_LOAN
See Also:
Constant Field Values

ACCOUNT_TYPE_EXPENSE

public static final int ACCOUNT_TYPE_EXPENSE
See Also:
Constant Field Values

ACCOUNT_TYPE_INCOME

public static final int ACCOUNT_TYPE_INCOME
See Also:
Constant Field Values

MAX_BUDGETS

public static final int MAX_BUDGETS
See Also:
Constant Field Values

BUDGET_INTERVAL_MONTHLY

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

BUDGET_INTERVAL_WEEKLY

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

BUDGET_INTERVAL_QUARTERLY

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

BUDGET_INTERVAL_YEARLY

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

BUDGET_CLASS_MISC

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

BUDGET_CLASS_DISCRETIONARY

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

BUDGET_CLASS_REQUIRED

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

BUDGET_CLASS_INCOME

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

PARAM_VAT_PCT

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

PARAM_VAT_ACCT

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

PARAM_VAT_APPLIES

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

PARAM_QIF_TXNID

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

negate

protected boolean negate
Constructor Detail

Account

public Account(java.lang.String acctName,
               int acctNum,
               int accountType,
               CurrencyType currency,
               java.util.Hashtable params,
               java.util.Vector subAccts,
               Account parentAcct,
               long startBalance)
Method Detail

isLeafNode

public final boolean isLeafNode()

getCheckNumTags

public java.lang.String[] getCheckNumTags(java.lang.String deflt)

setCheckNumTags

public void setCheckNumTags(java.lang.String[] checkTags)

getOFXLastTxnUpdate

public long getOFXLastTxnUpdate()

setCreationDate

public void setCreationDate(long date)
Sets the date that this account was opened. (this method only available as of build 253)


getCreationDate

public long getCreationDate()
Gets the date that this account was opened/created (this method only available as of build 253)


getCreationDateInt

public int getCreationDateInt()
Gets the date that this account was opened/created encoded as an int. (this method only available as of build 407)


setOFXLastTxnUpdate

public void setOFXLastTxnUpdate(long date)

getOFXAccountNumber

public java.lang.String getOFXAccountNumber()

setOFXAccountNumber

public void setOFXAccountNumber(java.lang.String str)

getOFXAccountKey

public java.lang.String getOFXAccountKey()

setOFXAccountKey

public void setOFXAccountKey(java.lang.String str)

setOFXAccountType

public void setOFXAccountType(java.lang.String str)

getOFXAccountType

public java.lang.String getOFXAccountType()

getOFXBankID

public java.lang.String getOFXBankID()
Bank ID: used or not according to country: BEL Bank code CAN Routing and transit number CHE Clearing number DEU Bankleitzah ESP Entidad FRA Banque GBR Sort code ITA ABI NLD Not used (field contents ignored) USA Routing and transit number


setOFXBankID

public void setOFXBankID(java.lang.String bankId)

getOFXBranchID

public java.lang.String getOFXBranchID()

setOFXBranchID

public void setOFXBranchID(java.lang.String branchId)

getOFXBrokerID

public java.lang.String getOFXBrokerID()

setOFXBrokerID

public void setOFXBrokerID(java.lang.String brokerId)

isOnlineBankingCandidate

public boolean isOnlineBankingCandidate()
Returns true if it is possible to online-enable this account.


isOnlineBillpayCandidate

public boolean isOnlineBillpayCandidate()
Returns true if it is possible to online-enable this account.


isOnlineEnabled

public boolean isOnlineEnabled()
Returns true if this account is configured for online access.


getBankingFI

public OnlineService getBankingFI()
Get the OFX connection information use for online banking in this account, if any.


setBankingFI

public void setBankingFI(OnlineService service)
Set the online banking connection information used for online banking (transaction download, etc) in this account.


getBillPayFI

public OnlineService getBillPayFI()
Get the OFX connection information use for online bill-payment in this account, if any.


setBillPayFI

public final void setBillPayFI(OnlineService service)
Set the online banking connection information used for online banking (transaction download, etc) in this account.


hasOnlineLedgerBalance

public boolean hasOnlineLedgerBalance()
Returns the ledger balance that was acquired from an online source, or zero if no balance was acquired.


getOnlineLedgerBalance

public long getOnlineLedgerBalance()
Returns the ledger balance that was acquired from an online source, or zero if no balance was acquired.


getOnlineLedgerBalanceDate

public long getOnlineLedgerBalanceDate()
Returns the 'as of' date for the ledger balance that was acquired from an online source, or zero if no balance was acquired.


setOnlineLedgerBalance

public void setOnlineLedgerBalance(long onlineBalance,
                                   long asOfDate)
Sets the ledger balance that was acquired from an online source.


hasOnlineAvailBalance

public boolean hasOnlineAvailBalance()
Returns the available balance that was acquired from an online source, or zero if no balance was acquired.


getOnlineAvailBalance

public long getOnlineAvailBalance()
Returns the available balance that was acquired from an online source, or zero if no balance was acquired.


getOnlineAvailBalanceDate

public long getOnlineAvailBalanceDate()
Returns the 'as of' date for the available balance that was acquired from an online source, or zero if no balance was acquired.


setOnlineAvailBalance

public void setOnlineAvailBalance(long onlineBalance,
                                  long asOfDate)
Sets the available balance that was acquired from an online source.


getHideOnHomePage

public final boolean getHideOnHomePage()

setHideOnHomePage

public final void setHideOnHomePage(boolean hide)

getDownloadedTxns

public final OnlineTxnList getDownloadedTxns()
Get the current list of downloaded transactions for this


downloadedTxnsUpdated

public void downloadedTxnsUpdated()

getBillpayTxns

public OnlineTxnList getBillpayTxns()

billpayTxnsUpdated

public void billpayTxnsUpdated()

getComment

public java.lang.String getComment()

setComment

public void setComment(java.lang.String comment)

getAllAccountNames

public java.lang.String[] getAllAccountNames()
Get an array of the account names between the root account and this account. This is basically the accounts names that make up the "path" from the root.


getFullAccountName

public java.lang.String getFullAccountName()

adjustStartBalance

public void adjustStartBalance(long adjustAmount)
Adjust the starting balance by the given amount. This will add the given amount to the starting balance.


balanceIsNegated

public final boolean balanceIsNegated()
Get the starting balance for this account


getUserStartBalance

public final long getUserStartBalance()

getUserCurrentBalance

public final long getUserCurrentBalance()

getUserClearedBalance

public final long getUserClearedBalance()

getUserReconcilingBalance

public final long getUserReconcilingBalance()

getUserBalance

public final long getUserBalance()

getStartBalance

public final long getStartBalance()

getRecursiveStartBalance

public long getRecursiveStartBalance()
Gets the starting balance for this account and all sub-accounts, converting the currencies of the sub-accounts at the appropriate exchange rate.


getRecursiveUserStartBalance

public long getRecursiveUserStartBalance()
Gets the starting balance for this account and all sub-accounts, converting the currencies of the sub-accounts at the appropriate exchange rate. This negates the balance if the account is negated


getCurrentBalance

public final long getCurrentBalance()

getRecursiveCurrentBalance

public final long getRecursiveCurrentBalance()
Gets the current balance for this account and all sub-accounts, converting the currencies of the sub-accounts at the current exchange rate. Note: This is method only available since build #274


getRecursiveUserCurrentBalance

public long getRecursiveUserCurrentBalance()
Gets the current balance for this account and all sub-accounts, converting the currencies of the sub-accounts at the appropriate exchange rate. This negates the balance if the account is negated


getClearedBalance

public final long getClearedBalance()

getRecursiveClearedBalance

public final long getRecursiveClearedBalance()
Gets the cleared balance for this account and all sub-accounts, converting the currencies of the sub-accounts at the current exchange rate. Note: This is method only available since build #274


getRecursiveUserClearedBalance

public long getRecursiveUserClearedBalance()
Gets the cleared balance for this account and all sub-accounts, converting the currencies of the sub-accounts at the appropriate exchange rate. This negates the balance if the account is negated


getReconcilingBalance

public final long getReconcilingBalance()

getRecursiveReconcilingBalance

public final long getRecursiveReconcilingBalance()
Gets the reconciling balance for this account and all sub-accounts, converting the currencies of the sub-accounts at the current exchange rate. Note: This is method only available since build #274


getRecursiveUserReconcilingBalance

public long getRecursiveUserReconcilingBalance()
Gets the reconciling balance for this account and all sub-accounts, converting the currencies of the sub-accounts at the appropriate exchange rate. This negates the balance if the account is negated


getBalance

public final long getBalance()

getRecursiveBalance

public final long getRecursiveBalance()
Gets the balance for this account and all sub-accounts, converting the currencies of the sub-accounts at the current exchange rate. Note: This is method only available since build #274


getRecursiveUserBalance

public long getRecursiveUserBalance()
Gets the balance for this account and all sub-accounts, converting the currencies of the sub-accounts at the appropriate exchange rate. This negates the balance if the account is negated


setStartBalance

public void setStartBalance(long newStartBalance)
Set the initial balance of this account.


setUserStartBalance

public void setUserStartBalance(long newStartBalance)
Set the initial balance of this account.


getCurrencyType

public final CurrencyType getCurrencyType()

setCurrencyType

public final void setCurrencyType(CurrencyType newCurrencyType)
set the currency type. NOTE: This should *not* be changed if there are transactions in this account!!!


getAccountName

public final java.lang.String getAccountName()

setAccountName

public final void setAccountName(java.lang.String newAccountName)

getAccountNum

public final int getAccountNum()

getAccountType

public final int getAccountType()

getBudgetAmount

public final long getBudgetAmount(int budgetNum)
Get the amount that is budgeted for this account, given the budget number.


setBudgetAmount

public final void setBudgetAmount(int budgetNum,
                                  long amount)
Set the amount that is budgeted for this account, given the budget number and the amount.


getBudgetInterval

public final java.lang.String getBudgetInterval(int budgetNum)
Get the interval (monthly, weekly, quarterly, etc) for the given budget


setBudgetInterval

public final void setBudgetInterval(int budgetNum,
                                    java.lang.String intervalID)
Set the interval (monthly, weekly, quarterly, etc) for the given budget


getBudgetClass

public final java.lang.String getBudgetClass(int budgetNum)
Get the class (misc, required, discretionary, etc) for the given budget


setBudgetClass

public final void setBudgetClass(int budgetNum,
                                 java.lang.String classID)
Get the class (misc, required, discretionary, etc) for the given budget


getPreferredTwoLines

public boolean getPreferredTwoLines(boolean defaultVal)

getPreferredSortOrder

public int getPreferredSortOrder(int defaultOrder)

getPreferredSortAscending

public boolean getPreferredSortAscending(boolean defaultVal)

setPreferredSortOrder

public void setPreferredSortOrder(int newSortOrder)

setPreferredSortAscending

public void setPreferredSortAscending(boolean ascending)

setPreferredTwoLines

public void setPreferredTwoLines(boolean twoLines)

getParameter

public final java.lang.String getParameter(java.lang.String parameterName)

getParameter

public final java.lang.String getParameter(java.lang.String parameterName,
                                           java.lang.String defaultStr)
Get the specified parameter name. If the given parameter does not have a value, return the given defaultStr


getIntParameter

public final int getIntParameter(java.lang.String parameterName,
                                 int defaultVal)
Get the specified parameter as an integer. If the given parameter does not have a value, or if it is not an integer, return the given defaul value


getLongParameter

public final long getLongParameter(java.lang.String parameterName,
                                   long defaultVal)
Get the specified parameter as a long. If the given parameter does not have a value, or if it is not a long, return the given defaul value. This method was created as of build 254.


getDoubleParameter

public double getDoubleParameter(java.lang.String parameterName,
                                 double defaultVal)
Get the specified parameter as an integer. If the given parameter does not have a value, or if it is not an double, return the given defaul value


getBooleanParameter

public final boolean getBooleanParameter(java.lang.String parameterName,
                                         boolean defaultVal)
Get the specified parameter as a boolean. If the given parameter does not have a value, or if it is not a boolean, return the given default value


setParameter

public final void setParameter(java.lang.String parameterName,
                               boolean parameterValue)
Set the given parameter name to the given boolean value


setParameter

public final void setParameter(java.lang.String parameterName,
                               int parameterValue)
Set the given parameter name to the given integer value


setParameter

public final void setParameter(java.lang.String parameterName,
                               long parameterValue)
Set the given parameter name to the given long value


setParameter

public final void setParameter(java.lang.String parameterName,
                               double parameterValue)
Set the given parameter name to the given double value


setParameter

public final void setParameter(java.lang.String parameterName,
                               java.lang.String parameterValue)
Set the given parameter name to the given value


setPreference

public final void setPreference(java.lang.String parameterName,
                                boolean parameterValue)
Set the given parameter name to the given boolean value, without sending an account-changed event, or recording the account as dirty.


setPreference

public final void setPreference(java.lang.String parameterName,
                                int parameterValue)
Set the given parameter name to the given integer value, without sending an account-changed event, or recording the account as dirty.


setPreference

public final void setPreference(java.lang.String parameterName,
                                java.lang.String parameterValue)
Set the given preference name to the given value. This does the exact same thing as setParameter, except this does not signal any change to the account when a value is modified. This is so that things like account register sort order can be stored with the account, without causing a recalculation of the balances and resynchronization with the view.


cloneParameters

public final java.util.Hashtable cloneParameters()

setParameterNoNotify

public final void setParameterNoNotify(java.lang.String parameterName,
                                       java.lang.String parameterValue)
Set the given parameter name to the given value but don't notify listeners of changes!


removeParameter

public final void removeParameter(java.lang.String parameterName)
Remove the parameter with the given name.


getParameterCount

public final int getParameterCount()
Get an enumeration of the keys of this accounts parameters


getParameterKeys

public final java.util.Enumeration getParameterKeys()

getDepth

public final int getDepth()
Get this accounts depth in the account tree. The root account will have depth 0.


getPath

public final Account[] getPath()
Get an array of the accounts leading up to this account, starting at the RootAccount.


getSubAccountCount

public final int getSubAccountCount()
Get the number of sub-accounts in this account.


getSubAccount

public final Account getSubAccount(int i)

indexOf

public final int indexOf(Account acct)

getSubAccounts

public final java.util.Enumeration getSubAccounts()

getAccountByName

public final Account getAccountByName(java.lang.String name)

_getAccountByName

protected final Account _getAccountByName(java.lang.String name)

getAccountByName

public final Account getAccountByName(java.lang.String name,
                                      int accountType)

_getAccountByName

protected final Account _getAccountByName(java.lang.String name,
                                          int accountType)

getParentAccount

public final Account getParentAccount()

setParentAccount

public final void setParentAccount(Account newParentAccount)

getDefaultCategory

public Account getDefaultCategory()

setDefaultCategory

public void setDefaultCategory(Account acct)

getNextCheckNumber

public final int getNextCheckNumber()

getRootAccount

public final RootAccount getRootAccount()

getTaxCategory

public java.lang.String getTaxCategory()
Get the identifier that indicates which (if any) tax category this account is associated with. (this method is only available as of build 253)


setTaxCategory

public void setTaxCategory(java.lang.String taxCategory)
Set an identifier that indicates which (if any) tax category this account is associated with. (this method is only available as of build 253)


getIndentedName

public final java.lang.String getIndentedName()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

isRegisterAccount

public final boolean isRegisterAccount()

resetDirtyFlags

protected void resetDirtyFlags()
set the dirty flag for this account and all sub-accounts to a non-dirty state. If an account is dirty, it means that it has been changed since the last time it was saved.


setDirtyFlag

public void setDirtyFlag()
set the dirty flag for this account. If an account is dirty, it means that it has been changed since the last time it was saved. This does NOT fire any events that indicate the account was modified. Note: only available since build 260.


isDirty

public final boolean isDirty()
Returns true if there has been changes to this account or any child accounts that hasn't been saved.

<