|
Venice 0.7beta | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.mov.portfolio.AbstractAccount
org.mov.portfolio.ShareAccount
public class ShareAccount
Representation of a share account in a portfolio.
| Field Summary |
|---|
| Fields inherited from interface org.mov.portfolio.Account |
|---|
CASH_ACCOUNT, SHARE_ACCOUNT |
| Constructor Summary | |
|---|---|
ShareAccount(java.lang.String name)
Create a new share account width the default currency. |
|
ShareAccount(java.lang.String name,
Currency currency)
Create a new share account with the given currency. |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Create a clone of this account. |
boolean |
equals(java.lang.Object object)
Compares this share account to another. |
StockHolding |
get(Symbol symbol)
Return the stock holding for a given symbol. |
Currency |
getCurrency()
Return the currency of the account. |
java.lang.String |
getName()
Return the name of this account. |
java.util.HashMap |
getStockHoldings()
Return all the stock holdings for this share account. |
int |
getType()
Return the type of this account. |
Money |
getValue(EODQuoteBundle quoteBundle,
int dateOffset)
Return the value of this account on the given day. |
Money |
getValue(EODQuoteBundle quoteBundle,
TradingDate date)
Return the value of this account on the given day. |
boolean |
isHolding(Symbol symbol)
Return whether the account is holding the current symbol. |
void |
removeAllTransactions()
Remove all transactions from account. |
int |
size()
Return the number of stock holdings in this share account. |
void |
transaction(Transaction transaction)
Perform a transaction on this account. |
| Methods inherited from class org.mov.portfolio.AbstractAccount |
|---|
compareTo |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ShareAccount(java.lang.String name,
Currency currency)
name - the name of the new share accountcurrency - the currency of the share accountpublic ShareAccount(java.lang.String name)
name - the name of the new share account| Method Detail |
|---|
public java.lang.Object clone()
clone in class java.lang.Objectpublic boolean equals(java.lang.Object object)
equals in class java.lang.Objectobject - another share account
true if the share accounts are equal; false otherwisepublic java.lang.String getName()
Account
getName in interface Account
public Money getValue(EODQuoteBundle quoteBundle,
TradingDate date)
throws MissingQuoteException
Account
getValue in interface AccountquoteBundle - the quote bundledate - the date
MissingQuoteException
public Money getValue(EODQuoteBundle quoteBundle,
int dateOffset)
throws MissingQuoteException
Account
getValue in interface AccountquoteBundle - the quote bundledateOffset - fast date offset
MissingQuoteExceptionpublic void transaction(Transaction transaction)
Account
transaction in interface Accounttransaction - transaction to occurpublic StockHolding get(Symbol symbol)
symbol - the stock symbol
null if we
do not own anypublic boolean isHolding(Symbol symbol)
symbol - the stock symbol
TRUE if we are holding the symbol; FALSE otherwisepublic java.util.HashMap getStockHoldings()
public int getType()
Account
getType in interface AccountAccount.CASH_ACCOUNT or
Account.SHARE_ACCOUNTpublic Currency getCurrency()
Account
getCurrency in interface Accountpublic void removeAllTransactions()
Account
removeAllTransactions in interface Accountpublic int size()
|
Venice 0.7beta | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||