|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Sector
Homework Assignment Number: 3, Problem Number: 2, File Name: Sector.java Creates a sector classification used for each Stock object.
Stock
,
StockCertificate
,
Portfolio
,
PortfolioTest
Constructor Summary | |
Sector()
default constuctor |
|
Sector(java.lang.String secName,
double secChance,
double secIndicator)
construcutor method to allow input |
Method Summary | |
double |
getChance()
method to get the chance |
boolean |
getGoodDay()
boolean method to determine whether it was a good day for the sector |
double |
getIndicator()
method to get the indicator |
java.lang.String |
getName()
method to get the name of the sector |
double |
getTypeDay()
method to get the type of day for the sector |
void |
goodDay()
method to set whether it is a good day for the sector based on the randomly chosen typeDay variable and comparing it to the chance variable |
void |
setTypeDay()
method to randomly choose a number between 0 and 1 and assign it to typeDay |
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 |
public Sector()
public Sector(java.lang.String secName, double secChance, double secIndicator)
Method Detail |
public java.lang.String getName()
public double getChance()
public double getIndicator()
public double getTypeDay()
public boolean getGoodDay()
public void setTypeDay()
public void goodDay()
no
- parameterspublic java.lang.String toString()
no
- parameters
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |