MYATM
2017-01-06 23:42:57 3 举报
ATM
作者其他创作
大纲/内容
ServerDaemon
public static final int PORT = 1234;public static int CURRENT_THREADS = 0;ServerSocket server;JTextArea area = new JTextArea();ArrayList users = new ArrayList();
public ServerDaemon();
Command
private String command;//命令是什么private Double amount;//存款金额是多少private int which;//对哪个款项进行操作private boolean tof = false;//操作是否顺利完成private String user=\"\";//新建用户的时候用private String password;//新用户的密码
public String getCommand();public void setCommand(String command);public Double getAmount();public void setAmount(Double amount);public String getUser();public void setUser(String user);public boolean isTof();public void setTof(boolean tof);public int getWhich();public void setWhich(int which);public String getPassword();public void setPassword(String password);
Client
User currentUser=new User();//当前用户的信息存在对象里Command send=new Command();//发送的信息Command receive=new Command();//接受的信息Socket client;ObjectOutputStream out;ObjectInputStream in;
User
private static final long serialVersionUID = 1L;private CheckBalance checkBalance;//活期账户只有一个private ArrayList halfBalances = new ArrayList();private ArrayList oneBalances = new ArrayList();private ArrayList fiveBalances = new ArrayList();private Double totalBalance;private Loan loan = new Loan(this);private boolean isFreezed=false;private String name=\"\";private String password=\"\";
public User();public Double calculateTotalBalance();public CheckBalance getCheckBalance();public void setCheckBalance(CheckBalance checkBalance);public ArrayList getHalfBalance();public void setHalfBalance(ArrayList halfBalances);public ArrayList getOneBalance();public void setOneBalance(ArrayList oneBalances);public ArrayList getFiveBalance();public void setFiveBalance(ArrayList fiveBalances);public Loan getLoan();public void setLoan(Loan loan);public boolean isFreezed();public void setFreezed(boolean isFreezed);public String getPassword();public void setPassword(String password);public String getName();public void setName(String name);public Double getTotalBalance();public void setTotalBalance(Double totalBalance);
Server
public static Connection getConnection();public void run();public void update();public Server(Socket s)public static void createDB();public void runThemAll(User user);public void loadDB();public boolean saveDB();public boolean newUser(User user);public boolean login(User user);public boolean load();public boolean depoCheck(Double amount);public boolean depoHalf(Double amount);public boolean depoOne(Double amount);public boolean depoFive(Double amount);public boolean withCheck(Double amount);public boolean withHalf(int which);public boolean withOne(int which);public boolean withFive(int which);public boolean getLoan(Double amount);public boolean payLoan();
OneBalance
Double cash=0.0;//现在的金额int timeCount=0;//季度数public Double capital=0.0;//本金public boolean expire = false;//是否到期
public HalfBalance(Double cash);public Double getUnexpired();public synchronized void run();public void increase();public Double getCash();public void setCash(Double cash);public int getTimeCount();public void setTimeCount(int timeCount);
HalfBalance
FiveBalance
Loan
public void pay();public Double getloan();public void setUser(User temp);public void calLoan();public boolean ableToLoan();public void deposit();public void withdrawl();public void query();public Double getCash();public void setCash(Double cash);public int getTimeCount();public void setTimeCount(int timeCount);public Loan(User u);public void run();public void increase();
Balance
public void run();public void increase();
CheckBalance
Double cash;//总钱数int timeCount=0;//季度数
public CheckBalance();public synchronized void run();public void increase();public Double getCash();public void setCash(Double cash);public int getTimeCount();public void setTimeCount(int timeCount);
0 条评论
下一页
为你推荐
查看更多
抱歉,暂无相关内容