|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object retail.Product retail.CD
public class CD
Field Summary | |
---|---|
static double |
DEFAULT_COST
default wholesale cost for a CD |
static double |
DEFAULT_PRICE
default price for a CD |
static int |
REORDER_BATCH
amount to re-order when re-supplying inventory |
Fields inherited from class retail.Product |
---|
currInventory, name, sku, totalSold |
Constructor Summary | |
---|---|
CD()
Creates a new default instance of CD |
|
CD(int skuLen,
java.lang.String nam,
double price,
double cost,
int inv,
int sold,
java.lang.String art,
MusicalGenre gr)
Creates a new instance of CD - generating an SKU of a given length randomly |
|
CD(int skuLen,
java.lang.String nam,
double price,
double cost,
int inv,
int sold,
java.lang.String art,
java.lang.String genr)
Creates a new instance of CD, passed genre as a string - generating an SKU of a given length randomly |
|
CD(java.util.Scanner lineScan)
Creates a new instance of CD given a properly positioned scanner - pointing to the appropriate place in a comma delimited string containing the name, cost, price, inventory, number sold, artist and (string representing the) genre (such as might be obtained via reading in a file that has one line per Song) Assumes info is organized in that order. |
|
CD(java.lang.String allInfo)
Creates a new instance of CD given a comma delimited string containing the name, cost, price, inventory, number sold, artist and (string representing the) genre (such as might be obtained via reading in a file that has one line per Song) Assumes info is organized in that order. |
|
CD(java.lang.String nam,
double price,
double cost,
int inv,
int sold,
java.lang.String art,
MusicalGenre gr)
Creates a new instance of CD - generating an SKU randomly |
|
CD(java.lang.String nam,
double price,
double cost,
int inv,
int sold,
java.lang.String art,
java.lang.String genr)
Creates a new instance of CD, passed genre as a string - generating an SKU randomly |
|
CD(java.lang.String id,
java.lang.String nam,
double price,
double cost,
int inv,
int sold,
java.lang.String art,
MusicalGenre gr)
Creates a new instance of CD |
|
CD(java.lang.String id,
java.lang.String nam,
double price,
double cost,
int inv,
int sold,
java.lang.String art,
java.lang.String genr)
Creates a new instance of CD, passed genre as a string |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object toCompare)
report whether passed object is completely equal in contents to invoking object |
java.lang.String |
getArtist()
report artist name |
MusicalGenre |
getGenre()
report cd genre |
java.lang.String |
getGenreString()
report cd genre as a String |
boolean |
setArtist(java.lang.String art)
change artist name No way to validate |
boolean |
setGenre(MusicalGenre gen)
change cd genre - uses enumerated type No way to validate? |
boolean |
setGenre(java.lang.String gen)
change cd genre - passing a string Make sure string corresponds to a real genre |
java.lang.String |
toShortString()
create a short string representation for the CD object |
java.lang.String |
toString()
create a string representation for the CD object |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final double DEFAULT_PRICE
public static final double DEFAULT_COST
public static final int REORDER_BATCH
Constructor Detail |
---|
public CD()
public CD(java.lang.String nam, double price, double cost, int inv, int sold, java.lang.String art, MusicalGenre gr)
public CD(int skuLen, java.lang.String nam, double price, double cost, int inv, int sold, java.lang.String art, MusicalGenre gr)
public CD(java.lang.String id, java.lang.String nam, double price, double cost, int inv, int sold, java.lang.String art, MusicalGenre gr)
public CD(java.lang.String nam, double price, double cost, int inv, int sold, java.lang.String art, java.lang.String genr)
public CD(int skuLen, java.lang.String nam, double price, double cost, int inv, int sold, java.lang.String art, java.lang.String genr)
public CD(java.lang.String id, java.lang.String nam, double price, double cost, int inv, int sold, java.lang.String art, java.lang.String genr)
public CD(java.util.Scanner lineScan)
public CD(java.lang.String allInfo)
Method Detail |
---|
public java.lang.String getArtist()
public MusicalGenre getGenre()
public java.lang.String getGenreString()
public boolean setArtist(java.lang.String art)
public boolean setGenre(MusicalGenre gen)
public boolean setGenre(java.lang.String gen)
public java.lang.String toString()
toString
in class Product
public boolean equals(java.lang.Object toCompare)
equals
in class Product
public java.lang.String toShortString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |