|
Venice 0.7beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mov.portfolio.StockHolding
public class StockHolding
Representation of a single stock holding in a share account.
ShareAccount
Constructor Summary | |
---|---|
StockHolding(Symbol symbol,
int shares,
double cost,
TradingDate date)
Create a new stock holding |
Method Summary | |
---|---|
void |
accumulate(int shares,
double cost)
Increase ownership of stock. |
boolean |
equals(java.lang.Object object)
Compares this stock holding to another. |
double |
getCost()
Get average cost per share |
TradingDate |
getDate()
Get the initial date that at least part of these shares was purchased on. |
int |
getShares()
Get number of shares held. |
Symbol |
getSymbol()
Get symbol of stock held. |
void |
reduce(int shares)
Decrease ownership of stock. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StockHolding(Symbol symbol, int shares, double cost, TradingDate date)
symbol
- the stock to ownshares
- the number of shares of that stockcost
- average cost per sharedate
- the date the shares were purchasedMethod Detail |
---|
public void accumulate(int shares, double cost)
shares
- number of new shares to accumulatecost
- average cost of sharespublic void reduce(int shares)
shares
- number of shares to reducepublic Symbol getSymbol()
public int getShares()
public double getCost()
public TradingDate getDate()
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- another stock holding
true
if the stock holdings are equal; false
otherwise
|
Venice 0.7beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |