All Packages  Class Hierarchy  This Package  Previous  Next  Index
  Class atm.ATM
java.lang.Object
   |
   +----atm.ATM
  -  public class ATM
  -  extends Object
  -  implements Runnable
Representation for the ATM itself.  An object of this class "owns"
  the objects representing the component parts of the ATM, and the
  communications network, and is responsible for creating customer 
  sessions which then use it to gain access to the component parts.
  This is an active class - when an instance of the class is created,
  a thread is executed that actually runs the system.
   
  -   bankAddress bankAddress
-  Internet address of the bank
  
-   bankName bankName
-  Name of the bank owning this ATM
  
-   cardInserted cardInserted
-  Becomes true when the card reader informs the ATM that a card has been
  inserted - the ATM will make this false when it has tried to read the
  card
  
-   cardReader cardReader
-  The ATM's card reader
  
-   cashDispenser cashDispenser
-  The ATM's cash dispenser
  
-   customerConsole customerConsole
-  The ATM's customer console
  
-   envelopeAcceptor envelopeAcceptor
-  The ATM's envelope acceptor
  
-   id id
-  Unique ID for this ATM
  
-   IDLE_STATE IDLE_STATE
-  The ATM is on, but idle.
  
-   log log
-  The ATM's log
  
-   networkToBank networkToBank
-  The ATM's network connection to the bank
  
-   OFF_STATE OFF_STATE
-  The ATM is off.
  
-   operatorPanel operatorPanel
-  The ATM's operator panel
  
-   place place
-  Physical location of this ATM
  
-   receiptPrinter receiptPrinter
-  The ATM's receipt printer
  
-   SERVING_CUSTOMER_STATE SERVING_CUSTOMER_STATE
-  The ATM is servicing a customer.
  
-   state state
-  The current state of the ATM - one of the possible values listed below
  
-   switchOn switchOn
-  Becomes true when the operator panel informs the ATM that the switch has
  been turned on - becomes false when the operator panel informs the ATM
  that the switch has been turned off.
   
  -   ATM(int, String, String, InetAddress) ATM(int, String, String, InetAddress)
-  Constructor
  
   
  -   cardInserted() cardInserted()
-  Inform the ATM that a card has been inserted into the card reader.
  
-   getBankName() getBankName()
-  Accessor for bank name
  
  
-   getCardReader() getCardReader()
-  Accessor for card reader
  
  
-   getCashDispenser() getCashDispenser()
-  Accessor for cash dispenser
  
  
-   getCustomerConsole() getCustomerConsole()
-  Accessor for customer console 
  
  
-   getEnvelopeAcceptor() getEnvelopeAcceptor()
-  Accessor for envelope acceptor
  
  
-   getID() getID()
-  Accessor for id
  
  
-   getLog() getLog()
-  Accessor for log
  
  
-   getNetworkToBank() getNetworkToBank()
-  Accessor for network to bank
  
  
-   getOperatorPanel() getOperatorPanel()
-  Accessor for operator panel
  
  
-   getPlace() getPlace()
-  Accessor for place
  
  
-   getReceiptPrinter() getReceiptPrinter()
-  Accessor for receipt printer
  
  
-   performShutdown() performShutdown()
-  Perform the System Shutdown use case when switch is turned off
  
-   performStartup() performStartup()
-  Perform the System Startup use case when switch is turned on
  
-   run() run()
-  The main program/applet will create a Thread that executes
  this code.
  
-   switchOff() switchOff()
-  Inform the ATM that the switch on the operator console has been moved
  to the "off" position.
  
-   switchOn() switchOn()
-  Inform the ATM that the switch on the operator console has been moved
  to the "on" position.
   
 id
id
 private int id
  -  Unique ID for this ATM
 
 place
place
 private String place
  -  Physical location of this ATM
 
 bankName
bankName
 private String bankName
  -  Name of the bank owning this ATM
 
 bankAddress
bankAddress
 private InetAddress bankAddress
  -  Internet address of the bank
 
 cardReader
cardReader
 private CardReader cardReader
  -  The ATM's card reader
 
 cashDispenser
cashDispenser
 private CashDispenser cashDispenser
  -  The ATM's cash dispenser
 
 customerConsole
customerConsole
 private CustomerConsole customerConsole
  -  The ATM's customer console
 
 envelopeAcceptor
envelopeAcceptor
 private EnvelopeAcceptor envelopeAcceptor
  -  The ATM's envelope acceptor
 
 log
log
 private Log log
  -  The ATM's log
 
 networkToBank
networkToBank
 private NetworkToBank networkToBank
  -  The ATM's network connection to the bank
 
 operatorPanel
operatorPanel
 private OperatorPanel operatorPanel
  -  The ATM's operator panel
 
 receiptPrinter
receiptPrinter
 private ReceiptPrinter receiptPrinter
  -  The ATM's receipt printer
 
 state
state
 private int state
  -  The current state of the ATM - one of the possible values listed below
 
 switchOn
switchOn
 private boolean switchOn
  -  Becomes true when the operator panel informs the ATM that the switch has
  been turned on - becomes false when the operator panel informs the ATM
  that the switch has been turned off.
 
 cardInserted
cardInserted
 private boolean cardInserted
  -  Becomes true when the card reader informs the ATM that a card has been
  inserted - the ATM will make this false when it has tried to read the
  card
 
 OFF_STATE
OFF_STATE
 private static final int OFF_STATE
  -  The ATM is off.  The switch must be turned on before it can operate
 
 IDLE_STATE
IDLE_STATE
 private static final int IDLE_STATE
  -  The ATM is on, but idle.  It can service a customer, or it can be shut down
 
 SERVING_CUSTOMER_STATE
SERVING_CUSTOMER_STATE
 private static final int SERVING_CUSTOMER_STATE
  -  The ATM is servicing a customer.
 
   
 ATM
ATM
 public ATM(int id,
            String place,
            String bankName,
            InetAddress bankAddress)
  -  Constructor
   
- 
    -  Parameters:
    
-  id - the unique ID for this ATM
    -  place - the physical location of this ATM
    -  bankName - the name of the bank owning this ATM
    -  bankAddress - the Internet address of the bank
  
 
   
 run
run
 public void run()
  -  The main program/applet will create a Thread that executes
  this code.
 
 switchOn
switchOn
 public synchronized void switchOn()
  -  Inform the ATM that the switch on the operator console has been moved
  to the "on" position.
 
 switchOff
switchOff
 public synchronized void switchOff()
  -  Inform the ATM that the switch on the operator console has been moved
  to the "off" position.
 
 cardInserted
cardInserted
 public synchronized void cardInserted()
  -  Inform the ATM that a card has been inserted into the card reader.
 
 getID
getID
 public int getID()
  -  Accessor for id
   
- 
    -  Returns:
    
-  unique id of this ATM
  
 
 getPlace
getPlace
 public String getPlace()
  -  Accessor for place
   
- 
    -  Returns:
    
-  physical location of this ATM
  
 
 getBankName
getBankName
 public String getBankName()
  -  Accessor for bank name
   
- 
    -  Returns:
    
-  name of bank owning this ATM
  
 
 getCardReader
getCardReader
 public CardReader getCardReader()
  -  Accessor for card reader
   
- 
    -  Returns:
    
-  card reader component of this ATM
  
 
 getCashDispenser
getCashDispenser
 public CashDispenser getCashDispenser()
  -  Accessor for cash dispenser
   
- 
    -  Returns:
    
-  cash dispenser component of this ATM
  
 
 getCustomerConsole
getCustomerConsole
 public CustomerConsole getCustomerConsole()
  -  Accessor for customer console
   
- 
    -  Returns:
    
-  customer console component of this ATM
  
 
 getEnvelopeAcceptor
getEnvelopeAcceptor
 public EnvelopeAcceptor getEnvelopeAcceptor()
  -  Accessor for envelope acceptor
   
- 
    -  Returns:
    
-  envelope acceptor component of this ATM
  
 
 getLog
getLog
 public Log getLog()
  -  Accessor for log
   
- 
    -  Returns:
    
-  log component of this ATM
  
 
 getNetworkToBank
getNetworkToBank
 public NetworkToBank getNetworkToBank()
  -  Accessor for network to bank
   
- 
    -  Returns:
    
-  network connection to bank of this ATM
  
 
 getOperatorPanel
getOperatorPanel
 public OperatorPanel getOperatorPanel()
  -  Accessor for operator panel
   
- 
    -  Returns:
    
-  operator panel component of this ATM
  
 
 getReceiptPrinter
getReceiptPrinter
 public ReceiptPrinter getReceiptPrinter()
  -  Accessor for receipt printer
   
- 
    -  Returns:
    
-  receipt printer component of this ATM
  
 
 performStartup
performStartup
 private void performStartup()
  -  Perform the System Startup use case when switch is turned on
 
 performShutdown
performShutdown
 private void performShutdown()
  -  Perform the System Shutdown use case when switch is turned off
 
All Packages  Class Hierarchy  This Package  Previous  Next  Index