jgnash.engine
Class TransactionEntryBuyX

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

public class TransactionEntryBuyX
extends AbstractInvestmentTransactionEntry

Buy shares and reduce the (cash) balance of an account

The investment account is always assigned to the debit account.

If an account other than the investment account is assigned to the credit account, then the balance of the credit account is reduced because the cost of the buy is made against it.

Version:
$Id$
Author:
Craig Cavanaugh

Constructor Summary
  TransactionEntryBuyX()
          Deprecated.  
protected TransactionEntryBuyX(Account account, Account investmentAccount, SecurityNode securityNode, java.math.BigDecimal price, java.math.BigDecimal quantity, java.math.BigDecimal exchangeRate)
          Constructor
 
Method Summary
 java.math.BigDecimal getSignedQuantity()
          Returns the number of shares as it would impact the sum of the investment accounts shares.
 TransactionType getTransactionType()
          Returns the type of this transaction entry
 
Methods inherited from class jgnash.engine.AbstractInvestmentTransactionEntry
getPrice, getQuantity, getSecurityNode, getTotal, 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

TransactionEntryBuyX

@Deprecated
public TransactionEntryBuyX()
Deprecated. 

No argument constructor for reflection purposes. Do not use to create a new instance


TransactionEntryBuyX

protected TransactionEntryBuyX(Account account,
                               Account investmentAccount,
                               SecurityNode securityNode,
                               java.math.BigDecimal price,
                               java.math.BigDecimal quantity,
                               java.math.BigDecimal exchangeRate)
Constructor

Parameters:
account - Credit account
investmentAccount - Debit / Investment account
securityNode - Security for the transaction
price - Price of shares
quantity - Number of shares
exchangeRate - Exchange rate for the credit account (May be ONE, but may not be null and must be greater than ZERO)
Method Detail

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