package coreservlets; /** Describes a catalog item for on-line store. The itemID * uniquely identifies the item, the short description * gives brief info like the book title and author, * the long description describes the item in a couple * of sentences, and the cost gives the current per-item price. * Both the short and long descriptions can contain HTML * markup. *
* Taken from Core Servlets and JavaServer Pages * from Prentice Hall and Sun Microsystems Press, * http://www.coreservlets.com/. * © 2000 Marty Hall; may be freely used or adapted. */ public class Item { private String itemID; private String shortDescription; private String longDescription; private double cost; public Item(String itemID, String shortDescription, String longDescription, double cost) { setItemID(itemID); setShortDescription(shortDescription); setLongDescription(longDescription); setCost(cost); } public String getItemID() { return(itemID); } protected void setItemID(String itemID) { this.itemID = itemID; } public String getShortDescription() { return(shortDescription); } protected void setShortDescription(String shortDescription) { this.shortDescription = shortDescription; } public String getLongDescription() { return(longDescription); } protected void setLongDescription(String longDescription) { this.longDescription = longDescription; } public double getCost() { return(cost); } protected void setCost(double cost) { this.cost = cost; } }