Class Stock

java.lang.Object
  |
  +--Stock

public class Stock
extends java.lang.Object


Constructor Summary
Stock()
          default constuctor
Stock(java.lang.String stockName, double origPrice1, double currPrice1, Sector type1)
          construcutor method to allow input
 
Method Summary
 void changeCurrentPrice()
          method to change the current price based on the type of day for the sector
 double getCurrentPrice()
          method to get the current price of the stock
 java.lang.String getName()
          method to get the name of the stock
 double getOriginalPrice()
          method to get the original price paid for stock
 Sector getType()
          method to get the Sector type
 void setPrice()
          method to determine the change in the price based on a number randomly chosen from 0 to 1 and multiplied by the indicator for the sector
 java.lang.String toString()
          report for validation purposes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Stock

public Stock()
default constuctor

Stock

public Stock(java.lang.String stockName,
             double origPrice1,
             double currPrice1,
             Sector type1)
construcutor method to allow input
Method Detail

getName

public java.lang.String getName()
method to get the name of the stock

getType

public Sector getType()
method to get the Sector type

getOriginalPrice

public double getOriginalPrice()
method to get the original price paid for stock

getCurrentPrice

public double getCurrentPrice()
method to get the current price of the stock

changeCurrentPrice

public void changeCurrentPrice()
method to change the current price based on the type of day for the sector
Parameters:
no - parameters

setPrice

public void setPrice()
method to determine the change in the price based on a number randomly chosen from 0 to 1 and multiplied by the indicator for the sector
Parameters:
no - parameters

toString

public java.lang.String toString()
report for validation purposes
Parameters:
no - parameters
Returns:
report with name, original price in US$ and current price in US$
Overrides:
toString in class java.lang.Object