All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class atm.physical.CardReader

java.lang.Object
   |
   +----atm.physical.CardReader

public class CardReader
extends Object
Manager for the ATM's card reader. In a real ATM, this would manage a physical device; in this simulation, it uses classes in package simulation to simulate the device.


Variable Index

 o atm
The ATM to which this card reader belongs

Constructor Index

 o CardReader(ATM)
Constructor

Method Index

 o ejectCard()
Eject the card that is currently inside the reader.
 o readCard()
Read a card that has been partially inserted into the reader
 o retainCard()
Retain the card that is currently inside the reader for action by the bank.

Variables

 o atm
 private ATM atm
The ATM to which this card reader belongs

Constructors

 o CardReader
 public CardReader(ATM atm)
Constructor

Parameters:
atm - the ATM that owns this card reader

Methods

 o readCard
 public Card readCard()
Read a card that has been partially inserted into the reader

Returns:
Card object representing information on the card if read successfully, null if not read successfully
 o ejectCard
 public void ejectCard()
Eject the card that is currently inside the reader.

 o retainCard
 public void retainCard()
Retain the card that is currently inside the reader for action by the bank.


All Packages  Class Hierarchy  This Package  Previous  Next  Index