package ATMSystem;
import java.io.Serializable;
/**
*
* @author zz384dian
* @description 用户信息
*/
public class User implements Serializable{
public String username;
public String password;
public double money;
public User(){
}
public User(String username, String password, double money) {
super();
this.username = username;
this.password = password;
this.money = money;
}
public void setMoney(double money) {
this.money = money;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
long temp;
temp = Double.doubleToLongBits(money);
result = prime * result + (int) (temp ^ (temp >>> 32));
result = prime * result + ((password == null) ? 0 : password.hashCode());
result = prime * result + ((username == null) ? 0 : username.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
User other = (User) obj;
if (Double.doubleToLongBits(money) != Double.doubleToLongBits(other.money))
return false;
if (password == null) {
if (other.password != null)
return false;
} else if (!password.equals(other.password))
return false;
if (username == null) {
if (other.username != null)
return false;
} else if (!username.equals(other.username))
return false;
return true;
}
}
package ATMSystem;
/**
*
* @author zz384dian
* @description 输入操作有误异常
*/
public class OperatorException extends Exception{
public OperatorException(){
}
public OperatorException(String message){
super(message);
}
}
package ATMSystem;
/**
*
* @author zz384dian
* @description money不够异常
*/
public class MoneyNotEnough extends Exception{
public MoneyNotEnough