A B C D E F G I M O P R S T U

A

AbsStockBlock - class stockportfolio.AbsStockBlock.
Information about a single block of stock.
AbsStockBlock(String, Date, double, double) - Constructor for class stockportfolio.AbsStockBlock
Create a new block of stock.
addToFront(Object) - Method in interface stockportfolio.IDQueue
Add (push) an element to the front of the queue; thus, the next dequeue operation would return this value, assuming there were no other intervening addToFront operations.
addToFront(Object) - Method in class stockportfolio.ObjectDQueue
 
addToFront(Object) - Method in class stockportfolio.StockQueue
 
addToFront(IStockBlock) - Method in class stockportfolio.StockQueue
 

B

BUY_COMMAND - Static variable in class stockportfolio.CommandReader
The BUY_COMMAND text for the CommandReader shell.
buy(String, Date, double, double) - Method in interface stockportfolio.IPortfolio
Add a block of stock to the portfolio.
buy(String, Date, double, double) - Method in class stockportfolio.Portfolio
 

C

CommandReader - class stockportfolio.CommandReader.
Simple text-based shell for stock portfolio manager.
CommandReader() - Constructor for class stockportfolio.CommandReader
Default constructor sets in and out to System.in and System.out, respectively.
compareTo(Object) - Method in class stockportfolio.StockBlock
Determine the relative order of two stock blocks.

D

dequeue() - Method in interface stockportfolio.IQueue
Remove an object from the queue.
dequeue() - Method in class stockportfolio.ObjectDQueue
 
dequeueStockBlock() - Method in class stockportfolio.StockQueue
 

E

EXIT_COMMAND - Static variable in class stockportfolio.CommandReader
The EXIT_COMMAND text for the CommandReader shell.
enqueue(Object) - Method in interface stockportfolio.IQueue
Push a new object on the queue.
enqueue(Object) - Method in class stockportfolio.ObjectDQueue
 
enqueue(Object) - Method in class stockportfolio.StockQueue
 
enqueue(IStockBlock) - Method in class stockportfolio.StockQueue
 
equals(Object) - Method in class stockportfolio.StockBlock
Test if two stock blocks have all the same field values.

F

front() - Method in interface stockportfolio.IQueue
Look at the front of the queue.
front() - Method in class stockportfolio.ObjectDQueue
 
frontStockBlock() - Method in class stockportfolio.StockQueue
 

G

getBlocksOwned() - Method in interface stockportfolio.IPortfolio
Return a list of all the blocks of stock that are owned.
getBlocksOwned() - Method in class stockportfolio.Portfolio
 
getObject(int) - Method in interface stockportfolio.IDQueue
Get an object from the queue.
getObject(int) - Method in class stockportfolio.ObjectDQueue
 
getPricePerShare() - Method in class stockportfolio.AbsStockBlock
 
getPricePerShare() - Method in interface stockportfolio.IStockBlock
Tells the price per share of shares in this block
getShares() - Method in class stockportfolio.AbsStockBlock
 
getShares() - Method in interface stockportfolio.IStockBlock
Tells the number of shares in this block
getSharesOwned(String) - Method in interface stockportfolio.IPortfolio
Tells the number of shares owned of a particular stock.
getSharesOwned(String) - Method in class stockportfolio.Portfolio
 
getStock() - Method in class stockportfolio.AbsStockBlock
 
getStock() - Method in interface stockportfolio.IStockBlock
Tells the stock which was bought or sold.
getStockBlock(int) - Method in class stockportfolio.StockQueue
 
getTotalShares() - Method in class stockportfolio.StockQueue
 
getTransactionDate() - Method in class stockportfolio.AbsStockBlock
 
getTransactionDate() - Method in interface stockportfolio.IStockBlock
Tells the date the stock was purchased.

I

IDQueue - interface stockportfolio.IDQueue.
An enhanced queue which permits which permits additional operations, such as pushing an element on the front.
IPortfolio - interface stockportfolio.IPortfolio.
Stock portfolio manager.
IQueue - interface stockportfolio.IQueue.
Interface for a queue of objects.
IStockBlock - interface stockportfolio.IStockBlock.
Information about one block of stock.
isEmpty() - Method in interface stockportfolio.IQueue
Tell whether the queue is empty.
isEmpty() - Method in class stockportfolio.ObjectDQueue
 
isFull() - Method in interface stockportfolio.IQueue
Tell whether the queue is full.
isFull() - Method in class stockportfolio.ObjectDQueue
 

M

main(String[]) - Static method in class stockportfolio.CommandReader
Simply sets up a command reader and runs it.

O

ObjectDQueue - class stockportfolio.ObjectDQueue.
An enhanced queue.
ObjectDQueue() - Constructor for class stockportfolio.ObjectDQueue
 

P

Portfolio - class stockportfolio.Portfolio.
A portfolio represents stocks that are owned.
Portfolio() - Constructor for class stockportfolio.Portfolio
Create a new, empty portfolio.

R

REPORT_COMMAND - Static variable in class stockportfolio.CommandReader
The REPORT_COMMAND text for the CommandReader shell.
run() - Method in class stockportfolio.CommandReader
The run method initiates the command processor

S

SELL_COMMAND - Static variable in class stockportfolio.CommandReader
The SELL_COMMAND text for the CommandReader shell.
StockBlock - class stockportfolio.StockBlock.
A concrete stock block.
StockBlock(String, Date, double, double) - Constructor for class stockportfolio.StockBlock
Create a new stock block
StockQueue - class stockportfolio.StockQueue.
A queue holding blocks of stock owned.
StockQueue() - Constructor for class stockportfolio.StockQueue
 
sell(String, Date, double, double) - Method in interface stockportfolio.IPortfolio
"Sell" a block of a stock, in the process calculating the capital gain on the stock.
sell(String, Date, double, double) - Method in class stockportfolio.Portfolio
 
setIn(BufferedReader) - Method in class stockportfolio.CommandReader
setIn allows for redirection of input so that you can get commands from a file.
setOut(PrintWriter) - Method in class stockportfolio.CommandReader
setOut allows for redirection of output so that you can send results to a file (or anywhere else)
size() - Method in interface stockportfolio.IQueue
Tells how many objects are currently in the queue.
size() - Method in class stockportfolio.ObjectDQueue
 
stockportfolio - package stockportfolio
 

T

toString() - Method in class stockportfolio.AbsStockBlock
Give out a one-line summary of the block information.
toString() - Method in interface stockportfolio.IPortfolio
Gives a compact summary of the information in the Portfolio.
toString() - Method in class stockportfolio.Portfolio
Gives a compact summary of the information in the Portfolio.
toString() - Method in class stockportfolio.StockQueue
 

U

USAGE - Static variable in class stockportfolio.CommandReader
The USAGE string for the CommandReader shell.

A B C D E F G I M O P R S T U