jgnash.engine
Class TransactionEntrySellX

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

public class TransactionEntrySellX
extends AbstractInvestmentTransactionEntry

Sell shares and increase the (cash) balance of an account

The investment account is always assigned to the credit account.

If an account other than the investment account is assigned to the debit account, then the balance of the debit account is increased because the gains of the sell are added to it.

Version:
$Id$
Author:
Craig Cavanaugh

Constructor Summary
  TransactionEntrySellX()
          Deprecated.  
protected TransactionEntrySellX(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

TransactionEntrySellX

@Deprecated
public TransactionEntrySellX()
Deprecated. 

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


TransactionEntrySellX

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

Parameters:
account - Debit account
investmentAccount - Credit / Investment account
securityNode - Security for the transaction
price - Price of shares
quantity - Number of shares
exchangeRate - Exchange rate for the debit 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