/* * Created on Apr 24, 2005 */ package stockportfolio; /***** COMPLETE THIS CLASS! */ /** A portfolio represents stocks that are owned. The portfolio remembers * the name of each share (or group of shares) and its purchase price. * The order in which the stocks are purchased is remembered so that a * "oldest sold first" calculation can be made for capital gain when a * stock is sold. It is assumed that stocks are added to the portfolio * in the order they are purchased and this order never changes. The stock * added in a single buy operation constitutes a "block". * The portfolio remembers these blocks and deletes them only when a full * block's worth of stock is sold. A block is never split up or combined * with another block. HOWEVER, if a stock sale only uses part of a block, * a new block is created to hold the remaining shares; such a block has * the same date and price per share as the original. The fact that it has * the same date implies it has the same order as the original block -- it * does NOT go to the rear of the queue. */ public class Portfolio implements IPortfolio { /** Create a new, empty portfolio. * */ public Portfolio() { } /** Gives a compact summary of the information in the Portfolio. * Should show the names of the stocks held, and the number of * shares of each; one per line, or several per line, is * recommended. */ public String toString() { } }