retail
Class DVD

java.lang.Object
  extended by retail.Product
      extended by retail.DVD
All Implemented Interfaces:
java.lang.Comparable

public class DVD
extends Product


Field Summary
static double DEFAULT_COST
          default wholesale cost for us for a DVD
static double DEFAULT_PRICE
          default sales price for a DVD
static int REORDER_BATCH
          amount to re-order when re-supplying inventory
 
Fields inherited from class retail.Product
currInventory, name, sku, totalSold
 
Constructor Summary
DVD()
          Creates a new instance of DVD
DVD(int skuLen, java.lang.String nam, double price, double cost, int inv, int sold, MovieGenre gr, MovieRating rat, int len)
          Creates a new instance of DVD given all info except sku is passed as a length - generating an SKU randomly
DVD(int skuLen, java.lang.String nam, double price, double cost, int inv, int sold, java.lang.String genr, java.lang.String rat, int len)
          Creates a new instance of DVD given all info except sku is passed as a length - generating an SKU randomly.
DVD(java.util.Scanner lineScan)
          Creates a new instance of DVD given a properly positioned scanner - pointing to the appropriate place in a comma delimited string containing the name, cost, price, inventory, number sold, and (string representing the) genre and rating and the length (such as might be obtained via reading in a file that has one line per Song) Assumes info is organized in that order.
DVD(java.lang.String allInfo)
          Creates a new instance of DVD given a comma delimited string containing the name, cost, price, artist and (string representing the) genre and rating and the length (such as might be obtained via reading in a file that has one line per DVD) Assumes info is organized in that order.
DVD(java.lang.String nam, double price, double cost, int inv, int sold, MovieGenre gr, MovieRating rat, int len)
          Creates a new instance of DVD given all info except sku - generating an SKU randomly
DVD(java.lang.String nam, double price, double cost, int inv, int sold, java.lang.String genr, java.lang.String rat, int len)
          Creates a new instance of DVD given all info except sku - generating an SKU randomly.
DVD(java.lang.String id, java.lang.String nam, double price, double cost, int inv, int sold, MovieGenre gr, MovieRating rat, int len)
          Creates a new instance of DVD given all info
DVD(java.lang.String id, java.lang.String nam, double price, double cost, int inv, int sold, java.lang.String genr, java.lang.String rat, int len)
          Creates a new instance of DVD given all info.
 
Method Summary
 boolean equals(java.lang.Object toCompare)
          report whether passed object is completely equal in contents to invoking object
 MovieGenre getGenre()
          report dvd genre
 java.lang.String getGenreString()
          report dvd genre as a String
 int getLength()
          report dvd length (in minutes)
 MovieRating getRated()
          report dvd rating
 java.lang.String getRatedString()
          report dvd rating as a String
 boolean setGenre(MovieGenre gen)
          change dvd genre No way to validate?
 boolean setGenre(java.lang.String gen)
          change dvd genre - passing a string Make sure string corresponds to a real genre
 boolean setLength(int len)
          change dvd length No way to validate? Well lets force it to be between 50 minutes and 400
 boolean setRated(MovieRating rat)
          change dvd rating No way to validate?
 boolean setRated(java.lang.String rat)
          change dvd genre - passing a string Make sure string corresponds to a real genre
 java.lang.String toShortString()
          create a short string representation for the DVD object
 java.lang.String toString()
          create a string representation for the CD object
 
Methods inherited from class retail.Product
addInventory, buy, compareTo, getCostOfGoodsSold, getCostOfGoodsSoldOld, getCostOfGoodsStocked, getCostOfGoodsStockedOld, getCurrInventory, getName, getProfit, getProfitMargin, getProfitOld, getRetailCost, getRevenues, getRevenuesOld, getSku, getSkuString, getTotalSold, getTotalStocked, getValueOfInventory, getValueOfInventoryOld, getWholesaleCost, setName, setRetailCost, setSku, setSku, setWholesaleCost
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_PRICE

public static final double DEFAULT_PRICE
default sales price for a DVD

See Also:
Constant Field Values

DEFAULT_COST

public static final double DEFAULT_COST
default wholesale cost for us for a DVD

See Also:
Constant Field Values

REORDER_BATCH

public static final int REORDER_BATCH
amount to re-order when re-supplying inventory

See Also:
Constant Field Values
Constructor Detail

DVD

public DVD()
Creates a new instance of DVD


DVD

public DVD(java.lang.String nam,
           double price,
           double cost,
           int inv,
           int sold,
           MovieGenre gr,
           MovieRating rat,
           int len)
Creates a new instance of DVD given all info except sku - generating an SKU randomly


DVD

public DVD(int skuLen,
           java.lang.String nam,
           double price,
           double cost,
           int inv,
           int sold,
           MovieGenre gr,
           MovieRating rat,
           int len)
Creates a new instance of DVD given all info except sku is passed as a length - generating an SKU randomly


DVD

public DVD(java.lang.String id,
           java.lang.String nam,
           double price,
           double cost,
           int inv,
           int sold,
           MovieGenre gr,
           MovieRating rat,
           int len)
Creates a new instance of DVD given all info


DVD

public DVD(java.lang.String nam,
           double price,
           double cost,
           int inv,
           int sold,
           java.lang.String genr,
           java.lang.String rat,
           int len)
Creates a new instance of DVD given all info except sku - generating an SKU randomly. enums passed as strings and must be checked


DVD

public DVD(int skuLen,
           java.lang.String nam,
           double price,
           double cost,
           int inv,
           int sold,
           java.lang.String genr,
           java.lang.String rat,
           int len)
Creates a new instance of DVD given all info except sku is passed as a length - generating an SKU randomly. enums passed as strings and must be checked


DVD

public DVD(java.lang.String id,
           java.lang.String nam,
           double price,
           double cost,
           int inv,
           int sold,
           java.lang.String genr,
           java.lang.String rat,
           int len)
Creates a new instance of DVD given all info. enums passed as strings and must be checked


DVD

public DVD(java.lang.String allInfo)
Creates a new instance of DVD given a comma delimited string containing the name, cost, price, artist and (string representing the) genre and rating and the length (such as might be obtained via reading in a file that has one line per DVD) Assumes info is organized in that order.


DVD

public DVD(java.util.Scanner lineScan)
Creates a new instance of DVD given a properly positioned scanner - pointing to the appropriate place in a comma delimited string containing the name, cost, price, inventory, number sold, and (string representing the) genre and rating and the length (such as might be obtained via reading in a file that has one line per Song) Assumes info is organized in that order. Scanner is updated by the Product constructor via side effects due to its being an object - it will be updated, moving on to the next item

Method Detail

getGenre

public MovieGenre getGenre()
report dvd genre


getGenreString

public java.lang.String getGenreString()
report dvd genre as a String


getRated

public MovieRating getRated()
report dvd rating


getRatedString

public java.lang.String getRatedString()
report dvd rating as a String


getLength

public int getLength()
report dvd length (in minutes)


setGenre

public boolean setGenre(MovieGenre gen)
change dvd genre No way to validate?


setGenre

public boolean setGenre(java.lang.String gen)
change dvd genre - passing a string Make sure string corresponds to a real genre


setRated

public boolean setRated(MovieRating rat)
change dvd rating No way to validate?


setRated

public boolean setRated(java.lang.String rat)
change dvd genre - passing a string Make sure string corresponds to a real genre


setLength

public boolean setLength(int len)
change dvd length No way to validate? Well lets force it to be between 50 minutes and 400


toString

public java.lang.String toString()
create a string representation for the CD object

Overrides:
toString in class Product

equals

public boolean equals(java.lang.Object toCompare)
report whether passed object is completely equal in contents to invoking object

Overrides:
equals in class Product

toShortString

public java.lang.String toShortString()
create a short string representation for the DVD object