com.moneydance.apps.md.model
Class InvestUtil

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

public abstract class InvestUtil
extends java.lang.Object

Miscellaneous investment functions


Method Summary
static double getAverageCost(SecurityAccount sec)
          Compute the average cost of the shares in the given security account.
static long getAverageCostBasis(SecurityAccount sec)
          Compute the average cost of the shares in the given security account.
static long getCostBasis(SecurityAccount sec)
          Returns the current cost basis for the given security.
static double getLotBasedCost(SecurityAccount sec)
          Compute and return the lot-based costs for the unsold securities.
static long getLotBasedCostBasis(SecurityAccount sec)
          Compute the cost of any unsold shares (which are determined based on user-specified lots).
static long getPerShareSalesNet(AbstractTxn atxn)
           
static boolean isCostBasisValid(SecurityAccount sec)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getPerShareSalesNet

public static long getPerShareSalesNet(AbstractTxn atxn)

getAverageCostBasis

public static long getAverageCostBasis(SecurityAccount sec)
Compute the average cost of the shares in the given security account. This tabulates the average cost of purchases minus the cost basis of sell transactions.


getAverageCost

public static double getAverageCost(SecurityAccount sec)
Compute the average cost of the shares in the given security account. This tabulates the average cost of purchases minus the cost basis of sell transactions.


getCostBasis

public static long getCostBasis(SecurityAccount sec)
Returns the current cost basis for the given security.


getLotBasedCostBasis

public static long getLotBasedCostBasis(SecurityAccount sec)
Compute the cost of any unsold shares (which are determined based on user-specified lots).


getLotBasedCost

public static double getLotBasedCost(SecurityAccount sec)
Compute and return the lot-based costs for the unsold securities. Which shares are unsold is determined by the user-specified lots.


isCostBasisValid

public static boolean isCostBasisValid(SecurityAccount sec)