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.


Variable Index

 o bankAddress
Internet address of the bank
 o bankName
Name of the bank owning this ATM
 o 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
 o cardReader
The ATM's card reader
 o cashDispenser
The ATM's cash dispenser
 o customerConsole
The ATM's customer console
 o envelopeAcceptor
The ATM's envelope acceptor
 o id
Unique ID for this ATM
 o IDLE_STATE
The ATM is on, but idle.
 o log
The ATM's log
 o networkToBank
The ATM's network connection to the bank
 o OFF_STATE
The ATM is off.
 o operatorPanel
The ATM's operator panel
 o place
Physical location of this ATM
 o receiptPrinter
The ATM's receipt printer
 o SERVING_CUSTOMER_STATE
The ATM is servicing a customer.
 o state
The current state of the ATM - one of the possible values listed below
 o 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.

Constructor Index

 o ATM(int, String, String, InetAddress)
Constructor

Method Index

 o cardInserted()
Inform the ATM that a card has been inserted into the card reader.
 o getBankName()
Accessor for bank name
 o getCardReader()
Accessor for card reader
 o getCashDispenser()
Accessor for cash dispenser
 o getCustomerConsole()
Accessor for customer console
 o getEnvelopeAcceptor()
Accessor for envelope acceptor
 o getID()
Accessor for id
 o getLog()
Accessor for log
 o getNetworkToBank()
Accessor for network to bank
 o getOperatorPanel()
Accessor for operator panel
 o getPlace()
Accessor for place
 o getReceiptPrinter()
Accessor for receipt printer
 o performShutdown()
Perform the System Shutdown use case when switch is turned off
 o performStartup()
Perform the System Startup use case when switch is turned on
 o run()
The main program/applet will create a Thread that executes this code.
 o switchOff()
Inform the ATM that the switch on the operator console has been moved to the "off" position.
 o switchOn()
Inform the ATM that the switch on the operator console has been moved to the "on" position.

Variables

 o id
 private int id
Unique ID for this ATM

 o place
 private String place
Physical location of this ATM

 o bankName
 private String bankName
Name of the bank owning this ATM

 o bankAddress
 private InetAddress bankAddress
Internet address of the bank

 o cardReader
 private CardReader cardReader
The ATM's card reader

 o cashDispenser
 private CashDispenser cashDispenser
The ATM's cash dispenser

 o customerConsole
 private CustomerConsole customerConsole
The ATM's customer console

 o envelopeAcceptor
 private EnvelopeAcceptor envelopeAcceptor
The ATM's envelope acceptor

 o log
 private Log log
The ATM's log

 o networkToBank
 private NetworkToBank networkToBank
The ATM's network connection to the bank

 o operatorPanel
 private OperatorPanel operatorPanel
The ATM's operator panel

 o receiptPrinter
 private ReceiptPrinter receiptPrinter
The ATM's receipt printer

 o state
 private int state
The current state of the ATM - one of the possible values listed below

 o 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.

 o 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

 o OFF_STATE
 private static final int OFF_STATE
The ATM is off. The switch must be turned on before it can operate

 o 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

 o SERVING_CUSTOMER_STATE
 private static final int SERVING_CUSTOMER_STATE
The ATM is servicing a customer.

Constructors

 o 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

Methods

 o run
 public void run()
The main program/applet will create a Thread that executes this code.

 o switchOn
 public synchronized void switchOn()
Inform the ATM that the switch on the operator console has been moved to the "on" position.

 o switchOff
 public synchronized void switchOff()
Inform the ATM that the switch on the operator console has been moved to the "off" position.

 o cardInserted
 public synchronized void cardInserted()
Inform the ATM that a card has been inserted into the card reader.

 o getID
 public int getID()
Accessor for id

Returns:
unique id of this ATM
 o getPlace
 public String getPlace()
Accessor for place

Returns:
physical location of this ATM
 o getBankName
 public String getBankName()
Accessor for bank name

Returns:
name of bank owning this ATM
 o getCardReader
 public CardReader getCardReader()
Accessor for card reader

Returns:
card reader component of this ATM
 o getCashDispenser
 public CashDispenser getCashDispenser()
Accessor for cash dispenser

Returns:
cash dispenser component of this ATM
 o getCustomerConsole
 public CustomerConsole getCustomerConsole()
Accessor for customer console

Returns:
customer console component of this ATM
 o getEnvelopeAcceptor
 public EnvelopeAcceptor getEnvelopeAcceptor()
Accessor for envelope acceptor

Returns:
envelope acceptor component of this ATM
 o getLog
 public Log getLog()
Accessor for log

Returns:
log component of this ATM
 o getNetworkToBank
 public NetworkToBank getNetworkToBank()
Accessor for network to bank

Returns:
network connection to bank of this ATM
 o getOperatorPanel
 public OperatorPanel getOperatorPanel()
Accessor for operator panel

Returns:
operator panel component of this ATM
 o getReceiptPrinter
 public ReceiptPrinter getReceiptPrinter()
Accessor for receipt printer

Returns:
receipt printer component of this ATM
 o performStartup
 private void performStartup()
Perform the System Startup use case when switch is turned on

 o performShutdown
 private void performShutdown()
Perform the System Shutdown use case when switch is turned off


All Packages  Class Hierarchy  This Package  Previous  Next  Index