Java Cart .

Java Cart ItemOfMedia java

package cart;

//ItemOfMedia - an item which is media
//author - Lawrence Truett - FluffyCat.com
//date - July 22, 2003 - San Diego, CA
public class ItemOfMedia extends Item {
    public ItemOfMedia(long keyIn, 
                       double priceIn, 
                       String descriptionIn,
                       ItemType typeIn, 
                       String smallGraphicIn, 
                       String largeGraphicIn) {
        super(keyIn, 
              priceIn, 
              descriptionIn, 
              typeIn, 
              smallGraphicIn, 
              largeGraphicIn);
        this.setHasInventory(false);
        this.setOnePerCart(true);
    }
    
    public double getPriceForQuantity(long quantityIn) {
        //overridden for only selling one media
        return getPrice();
    }
    
    public static String getItemClass() {
        return "Media Item";
    }
}
To download source right-click here and "Save As...".
Comments
Sign in to be the first to comment on Java Cart ItemOfMedia java.