📄 shoppingcartproduct.java
字号:
package oracle.otnsamples.AQ.Helper;
/**
* @author Rajat Gupta
* @version 1.0
*
* Name of the Application : ShoppingCartProduct.java
* Development Environment : Oracle 9i JDeveloper
* Creation/Modification History :
*
* Rajat Gupta 15-Jan-2001 Created
*
*/
/**
* This is a Java Bean with private fields and get/set methods for accessing them.
* This object maps directly to a product added to the Shopping Cart.
*/
public class ShoppingCartProduct extends Product{
/**
* Quantity Added to the Shopping Cart
*/
private String m_quantityOrdered;
/**
* Total Price of the Product.
*/
private String m_totalPrice;
/**
* Default Constructor
*
* @see Product.java
*/
public ShoppingCartProduct(){
super();
}
/**
* This constructor can be used if all the parameters of the product are known
*
* @exception Exception In case of some unreported Exception
* @param p_productID Product ID
* @param p_manufacturerID Manufacturer ID
* @param p_productName Product Name
* @param p_manufacturerName Manufacturer Name
* @param p_productPrice Price of the Product
* @param p_categoryDesc Category to which the Product belongs to
* @param p_quantityOrdered Quantity Ordered
* @param p_productDesc Description of the product
* @param p_totalPrice Total price of the Product
* @param p_quantityOnHand Quantity available
* @see Product.java
*/
public ShoppingCartProduct(String p_productID, String p_manufacturerID,
String p_productName, String p_manufacturerName,
String p_productPrice, String p_categoryDesc,
String p_quantityOrdered, String p_productDesc,
String p_totalPrice, String p_quantityOnHand ) throws Exception{
super(p_productID, p_productName, p_productDesc, p_manufacturerName,
p_manufacturerID, p_productPrice, p_categoryDesc, p_quantityOnHand);
setQuantityOrdered(p_quantityOrdered);
setTotalPrice(p_totalPrice);
}
/**
* This constructor can be used if the Product Class Object is available.
* This constructor calls the Super Class Constructor with the necessary
* values which it gets from the Product Class Object.
*
* @param p_product Available Product Class Object
* @param p_quantityOrdered Quantity to be added to the Shopping Cart
* @param p_totalPrice Total Price
* @exception Exception In case of some unreported Exception
* @see Product.java
*/
public ShoppingCartProduct(Product p_product, String p_quantityOrdered,
String p_totalPrice) throws Exception{
super(p_product.getProductID(), p_product.getProductName(), p_product.getProductDesc(),
p_product.getManufacturerName(), p_product.getManufactureID(),
p_product.getProductPrice(), p_product.getCategoryDesc(), p_product.getQuantityOnHand());
setQuantityOrdered(p_quantityOrdered);
setTotalPrice(p_totalPrice);
}
/**
* Retrieves Quantity Ordered
*
* @exception Exception In case of some unreported Exception
* @return Quantity Ordered
*/
public String getQuantityOrdered() throws Exception{
return m_quantityOrdered;
}
/**
* Sets the Ordered Quantity to the new value
*
* @param p_quantityOrdered Quantity Ordered
* @exception Exception In case of some unreported Exception
*/
public void setQuantityOrdered(String p_quantityOrdered) throws Exception{
m_quantityOrdered = p_quantityOrdered;
}
/**
* Retrieves the total price
*
* @exception Exception In case of some unreported Exception
* @return Total Price
*/
public String getTotalPrice() throws Exception{
return m_totalPrice;
}
/**
* Sets the total price to a new value
*
* @param p_totalPrice Total Price
* @exception Exception In case of some unreported Exception
*/
public void setTotalPrice(String p_totalPrice) throws Exception{
m_totalPrice = p_totalPrice;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -