jgnash.engine
Class InvestmentPerformanceSummary
java.lang.Object
jgnash.engine.InvestmentPerformanceSummary
public class InvestmentPerformanceSummary
- extends java.lang.Object
Investment Performance Summary Class
- Version:
- $Id$
- Author:
- Craig Cavanaugh
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
account
private Account account
startDate
private java.util.Date startDate
endDate
private java.util.Date endDate
performanceData
private java.util.Map<SecurityNode,InvestmentPerformanceSummary.SecurityPerformanceData> performanceData
transactions
private java.util.List<Transaction> transactions
baseCurrency
private CurrencyNode baseCurrency
InvestmentPerformanceSummary
public InvestmentPerformanceSummary(Account account,
boolean recursive)
InvestmentPerformanceSummary
public InvestmentPerformanceSummary(Account account,
java.util.Date startDate,
java.util.Date endDate,
boolean recursive)
collectSubAccountTransactions
private void collectSubAccountTransactions(Account account,
java.util.List<Transaction> transactions)
collectSubAccountSecurities
private void collectSubAccountSecurities(Account account,
java.util.Set<SecurityNode> securities)
getPerformanceData
public InvestmentPerformanceSummary.SecurityPerformanceData getPerformanceData(SecurityNode node)
getSecurities
public java.util.List<SecurityNode> getSecurities()
calculateCostBasis
private void calculateCostBasis(InvestmentPerformanceSummary.SecurityPerformanceData data,
java.util.List<Transaction> transactions)
- Calculates the cost basis of a given security which is the average cost including fees
- Parameters:
data - SecurityPerformanceData object to save the result intransactions - transactions to calculate cost basis against
calculateRealizedGains
private void calculateRealizedGains(InvestmentPerformanceSummary.SecurityPerformanceData data,
java.util.List<Transaction> transactions)
- Calculates the realized gains of a given Security
- Parameters:
data - SecurityPerformanceData object to save the result intransactions - transactions to calculate the realized gains
calculateUnrealizedGains
private void calculateUnrealizedGains(InvestmentPerformanceSummary.SecurityPerformanceData data)
calculateTotalGains
private void calculateTotalGains(InvestmentPerformanceSummary.SecurityPerformanceData data)
calculateShares
private void calculateShares(InvestmentPerformanceSummary.SecurityPerformanceData data,
java.util.List<Transaction> transactions)
- Sums the number of given security shares
- Parameters:
data - SecurityPerformanceData object to save the result intransactions - transactions to count shares against
calculatePercentPortfolio
private void calculatePercentPortfolio()
runCalculations
private void runCalculations(boolean recursive)
getMarketPrice
private java.math.BigDecimal getMarketPrice(SecurityNode node,
java.util.Date date)
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
setStartDate
private void setStartDate(java.util.Date startDate)
getStartDate
public java.util.Date getStartDate()
setEndDate
private void setEndDate(java.util.Date endDate)
getEndDate
public java.util.Date getEndDate()