|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectstockportfolio.AbsStockBlock
Information about a single block of stock. A "block" is defined by a number of shares of the same stock, purchased at the same time at the same price. You shouldn't need change this class, if you even use it.
Constructor Summary | |
AbsStockBlock(java.lang.String stock,
java.util.Date date,
double amount,
double pricePerShare)
Create a new block of stock. |
Method Summary | |
double |
getPricePerShare()
Tells the price per share of shares in this block |
double |
getShares()
Tells the number of shares in this block |
java.lang.String |
getStock()
Tells the stock which was bought or sold. |
java.util.Date |
getTransactionDate()
Tells the date the stock was purchased. |
java.lang.String |
toString()
Give out a one-line summary of the block information. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public AbsStockBlock(java.lang.String stock, java.util.Date date, double amount, double pricePerShare)
stock
- a non-null string, which should be normalized and
used as the stock name.date
- a non-null date, when the stock was purchased.amount
- the number of shares purchased (must be > 0).pricePerShare
- the price per shape (must be > 0).Method Detail |
public java.lang.String getStock()
IStockBlock
getStock
in interface IStockBlock
public java.util.Date getTransactionDate()
IStockBlock
getTransactionDate
in interface IStockBlock
public double getShares()
IStockBlock
getShares
in interface IStockBlock
public double getPricePerShare()
IStockBlock
getPricePerShare
in interface IStockBlock
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |