jgnash.engine
Class TransactionEntryDividendX

java.lang.Object
  extended by jgnash.engine.TransactionEntry
      extended by jgnash.engine.AbstractInvestmentTransactionEntry
          extended by jgnash.engine.TransactionEntryDividendX
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable<TransactionEntry>

public class TransactionEntryDividendX
extends AbstractInvestmentTransactionEntry

Investment dividend.

The creditAccount and creditAmount fields are used for the investment account. The debitAccount and debitAmount fields are used for the capital gains (income) account. creditAccount is assumed to be the investment account.

Version:
$Id$
Author:
Craig Cavanaugh

Constructor Summary
  TransactionEntryDividendX()
          No argument constructor for reflection purposes only.
protected TransactionEntryDividendX(Account incomeAccount, Account investmentAccount, SecurityNode securityNode, java.math.BigDecimal dividend, java.math.BigDecimal incomeExchangedAmount)
          Constructor
 
Method Summary
 java.math.BigDecimal getSignedQuantity()
          Returns the number of shares as it would impact the sum of the investment accounts shares.
 java.math.BigDecimal getTotal()
          Calculates the total of the value of the shares, gains, fees, etc.
 TransactionType getTransactionType()
          Returns the type of this transaction entry
 
Methods inherited from class jgnash.engine.AbstractInvestmentTransactionEntry
getPrice, getQuantity, getSecurityNode, setPrice, setQuantity, setSecurityNode, toString
 
Methods inherited from class jgnash.engine.TransactionEntry
clone, compareTo, equals, equals, getAmount, getCreditAccount, getCreditAmount, getCreditReconciled, getDebitAccount, getDebitAmount, getDebitReconciled, getMemo, getReconciled, getTransactionTag, hashCode, isSingleEntry, setAmount, setCreditAccount, setCreditAmount, setCreditReconciled, setDebitAccount, setDebitAmount, setDebitReconciled, setMemo, setReconciled, setTransactionTag
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TransactionEntryDividendX

public TransactionEntryDividendX()
No argument constructor for reflection purposes only. Do not use to create a new instance


TransactionEntryDividendX

protected TransactionEntryDividendX(Account incomeAccount,
                                    Account investmentAccount,
                                    SecurityNode securityNode,
                                    java.math.BigDecimal dividend,
                                    java.math.BigDecimal incomeExchangedAmount)
Constructor

Parameters:
incomeAccount - Debit account
investmentAccount - Credit/Investment account
securityNode - Security for the transaction
dividend - Dividend received
incomeExchangedAmount - Exchanged amount for the debit account
Method Detail

getTotal

public java.math.BigDecimal getTotal()
Description copied from class: AbstractInvestmentTransactionEntry
Calculates the total of the value of the shares, gains, fees, etc. as it pertains to an account.

Not intended for use to calculate account balances

Overrides:
getTotal in class AbstractInvestmentTransactionEntry
Returns:
total resulting total for this entry
See Also:
InvestmentTransaction.getTotal(jgnash.engine.Account)

getSignedQuantity

public java.math.BigDecimal getSignedQuantity()
Returns the number of shares as it would impact the sum of the investment accounts shares. Useful for summing share quantities

Specified by:
getSignedQuantity in class AbstractInvestmentTransactionEntry
Returns:
the quantity of securities for this transaction

getTransactionType

public TransactionType getTransactionType()
Description copied from class: AbstractInvestmentTransactionEntry
Returns the type of this transaction entry

Specified by:
getTransactionType in class AbstractInvestmentTransactionEntry
Returns:
the transaction type