com.moneydance.apps.md.model
Class AssetTypeGroup

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

public class AssetTypeGroup
extends java.lang.Object

Tracks the list of accounts and balances for a particular asset type.

Author:
Kevin Menningen - Mennē Software Solutions, LLC

Constructor Summary
AssetTypeGroup(java.lang.String assetType, CurrencyType baseCurr, int asofDate)
          Constructor to provide the output currency.
 
Method Summary
 void addAccount(Account account, long balance)
          Add an account to the asset type.
 java.util.List<Account> getAccountList()
           
 long getBalance(Account account)
          Get the balance for the specified account, as of the specified date.
 double getPercent(Account account)
          Get the percentage of an account's balance with respect to the entire asset group's balance, for the specified account, as of the specified date.
 long getTotalBalance()
          Obtain the total balance for the entire asset group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssetTypeGroup

public AssetTypeGroup(java.lang.String assetType,
                      CurrencyType baseCurr,
                      int asofDate)
Constructor to provide the output currency.

Parameters:
assetType - The asset/security type and subtype (colon-separated).
baseCurr - The base currency to use.
asofDate - The effective date of the balances herein.
Method Detail

addAccount

public void addAccount(Account account,
                       long balance)
Add an account to the asset type.

Parameters:
account - The account to add.
balance - The balance of the account as of the date specified by _asofDate.

getAccountList

public java.util.List<Account> getAccountList()
Returns:
The list of accounts included in this asset group on the specified date.

getBalance

public long getBalance(Account account)
Get the balance for the specified account, as of the specified date.

Parameters:
account - The account to get the balance for.
Returns:
The balance, or zero if the account wasn't found.

getPercent

public double getPercent(Account account)
Get the percentage of an account's balance with respect to the entire asset group's balance, for the specified account, as of the specified date.

Parameters:
account - The account to get the balance for.
Returns:
The balance, or zero if the account wasn't found or if the asset group's balance is 0.

getTotalBalance

public long getTotalBalance()
Obtain the total balance for the entire asset group.

Returns:
The balance, in the base currency, of the entire asset group.