📄 saleline.java
字号:
/*
* 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -