/* * Created on Apr 24, 2005 */ package stockportfolio; import java.util.Date; /** Information about one block of stock. * Concrete implementations should have a constructor with parameters *
stock *
Date dateBought *
double numShares, must be >0 *
double pricePerShare, must be >0 */ public interface IStockBlock { /** Tells the stock which was bought or sold. This should be the * "normalized" stock name (see instructions). * * @return a non-null String */ String getStock(); /** Tells the date the stock was purchased. * * @return non-null date the stock was purchased */ Date getTransactionDate(); /** Tells the number of shares in this block * * @return the number of shares, which is always >0. */ double getShares(); /** Tells the price per share of shares in this block * * @return the price per share, which must be >0 */ double getPricePerShare(); }