saleslineitem.java

来自「网上购物系统,实现了一个具体的框架」· Java 代码 · 共 47 行

JAVA
47
字号
/**
 * @name SalesLineItem.class
 * @version 1.0
 * @author Administrator/pan
 * @date 2009/2/11
 */
package com.digitstore.process;

public class SalesLineItem {
	//商品
	private ProductSpecification prodSpec;
	//数量
	private int quantity;
	
	//构造函数
	public SalesLineItem(ProductSpecification procSpec, int quantity){
		this.prodSpec = procSpec;
		this.quantity = quantity;
	}
	
	//相应的get/set方法
	public ProductSpecification getprodSpec(){
		return prodSpec;
	}
	
	public void setprodSpec(Item item){
		this.prodSpec = prodSpec;
	}
	
	public int getQuantity(){
		return quantity;
	}
	
	public void setQuantity(int quantity){
		this.quantity = quantity;
	}
	
	//获取本条目的总价
	public double getSubTotal(){
		return prodSpec.getPrice()*quantity;
		
	}
	
	

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?