net.sourceforge.eclipsetrader.core.db
Class Account

java.lang.Object
  extended byjava.util.Observable
      extended bynet.sourceforge.eclipsetrader.core.db.PersistentObject
          extended bynet.sourceforge.eclipsetrader.core.db.Account
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
DefaultAccount

public abstract class Account
extends PersistentObject
implements java.lang.Cloneable


Constructor Summary
Account()
           
Account(java.lang.Integer id)
           
 
Method Summary
 java.lang.Object clone()
           
 double getBalance()
          Gets the balance of the account
 java.util.Currency getCurrency()
           
 java.lang.String getDescription()
           
 double getExpenses(Security security, int quantity, double price)
           
 AccountGroup getGroup()
           
 double getInitialBalance()
           
 java.lang.String getPluginId()
           
 java.util.List getPortfolio()
           
 PortfolioPosition getPortfolio(Security security)
           
 int getPosition(Security security)
          Return the number of stocks held for the given security.
 PersistentPreferenceStore getPreferenceStore()
           
 ObservableList getTransactions()
           
 void setCurrency(java.util.Currency currency)
           
 void setDescription(java.lang.String description)
           
 void setGroup(AccountGroup group)
           
 void setInitialBalance(double initbalance)
           
 void setPluginId(java.lang.String serviceId)
           
 void setPreferenceStore(PersistentPreferenceStore preferenceStore)
           
 void setTransactions(java.util.List transactions)
           
 
Methods inherited from class net.sourceforge.eclipsetrader.core.db.PersistentObject
clearChanged, equals, getData, getId, getRepository, setChanged, setData, setId, setRepository
 
Methods inherited from class java.util.Observable
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Account

public Account()

Account

public Account(java.lang.Integer id)
Method Detail

getPluginId

public java.lang.String getPluginId()

setPluginId

public void setPluginId(java.lang.String serviceId)

getDescription

public java.lang.String getDescription()

setDescription

public void setDescription(java.lang.String description)

getCurrency

public java.util.Currency getCurrency()

setCurrency

public void setCurrency(java.util.Currency currency)

getInitialBalance

public double getInitialBalance()

setInitialBalance

public void setInitialBalance(double initbalance)

getGroup

public AccountGroup getGroup()

setGroup

public void setGroup(AccountGroup group)

getPreferenceStore

public PersistentPreferenceStore getPreferenceStore()

setPreferenceStore

public void setPreferenceStore(PersistentPreferenceStore preferenceStore)

getTransactions

public ObservableList getTransactions()

setTransactions

public void setTransactions(java.util.List transactions)

getBalance

public double getBalance()
Gets the balance of the account

Returns:
the account's balance

getPosition

public int getPosition(Security security)
Return the number of stocks held for the given security.

Parameters:
security - the security to search
Returns:
holded quantity

getPortfolio

public java.util.List getPortfolio()

getPortfolio

public PortfolioPosition getPortfolio(Security security)

getExpenses

public double getExpenses(Security security,
                          int quantity,
                          double price)

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Throws:
java.lang.CloneNotSupportedException