inquiry.java
来自「含有uml的多个实例及实例的java源码。」· Java 代码 · 共 70 行
JAVA
70 行
/* * ATM Example system - file Inquiry.java * * copyright (c) 2001 - Russell C. Bjork * */ package atm.transaction;import atm.ATM;import atm.Session;import atm.physical.*;import banking.AccountInformation;import banking.Card;import banking.Message;import banking.Money;import banking.Status;import banking.Receipt;/** Representation for a balance inquiry transaction */public class Inquiry extends Transaction{ /** Constructor * * @param atm the ATM used to communicate with customer * @param session the session in which the transaction is being performed * @param card the customer's card * @param pin the PIN entered by the customer */ public Inquiry(ATM atm, Session session, Card card, int pin) { super(atm, session, card, pin); } /** Get specifics for the transaction from the customer * * @return message to bank for initiating this transaction * @exception CustomerConsole.Cancelled if customer cancelled this transaction */ protected Message getSpecificsFromCustomer() throws CustomerConsole.Cancelled { from = atm.getCustomerConsole().readMenuChoice( "Account to inquire from", AccountInformation.ACCOUNT_NAMES); return new Message(Message.INQUIRY, card, pin, serialNumber, from, -1, new Money(0)); } /** Complete an approved transaction * * @return receipt to be printed for this transaction */ protected Receipt completeTransaction() { return new Receipt(this.atm, this.card, this, this.balances) { { detailsPortion = new String[2]; detailsPortion[0] = "INQUIRY FROM: " + AccountInformation.ACCOUNT_ABBREVIATIONS[from]; detailsPortion[1] = ""; } }; } /** Account to inquire about */ private int from; }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?