saleline.java
来自「web开发经典案例shoppingcart的EJB实现其entity部分」· Java 代码 · 共 55 行
JAVA
55 行
/*
* SaleLine.java
*
* Created on 2008年6月2日, 上午9:40
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package stateful;
import java.io.Serializable;
/**
*
* @author teacher
*/
public class SaleLine implements Serializable{
private int qty;
private Product product;
/** Creates a new instance of SaleLine */
public SaleLine() {
}
public int getQty() {
return qty;
}
public void setQty(int qty) {
this.qty = qty;
}
public Product getProduct() {
return product;
}
public void setProduct(Product product) {
this.product = product;
}
public boolean equals(Object obj) {
boolean retValue = false;
if(obj instanceof SaleLine){
SaleLine s = (SaleLine)obj;
retValue = s.getProduct().equals(product);
}
return retValue;
}
public int hashCode() {
return product.hashCode();
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?