cscie160.hw5
Class ATMImpl
java.lang.Object
|
+--java.rmi.server.RemoteObject
|
+--java.rmi.server.RemoteServer
|
+--java.rmi.server.UnicastRemoteObject
|
+--cscie160.hw5.ATMImpl
- All Implemented Interfaces:
- ATM, java.rmi.Remote, java.io.Serializable
- public class ATMImpl
- extends java.rmi.server.UnicastRemoteObject
- implements ATM
- See Also:
- Serialized Form
Fields inherited from class java.rmi.server.RemoteObject |
ref |
Constructor Summary |
ATMImpl()
|
Constructor. |
Method Summary |
void |
deposit(int mAccountNum,
float mAmount)
|
Tells account to deposit [amount]. |
cscie160.hw5.Account |
getAccount(int mAccountNum)
|
Asks account for the balance in that account. |
float |
getBalance(int mAccountNum)
|
Asks account for the balance in that account. |
void |
withdraw(int mAccountNum,
float mAmount)
|
Tells account to withdraw [amount] |
Methods inherited from class java.rmi.server.UnicastRemoteObject |
clone, exportObject, exportObject, exportObject, unexportObject |
Methods inherited from class java.rmi.server.RemoteServer |
getClientHost, getLog, setLog |
Methods inherited from class java.rmi.server.RemoteObject |
equals, getRef, hashCode, toString, toStub |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
ATMImpl
public ATMImpl()
throws java.rmi.RemoteException
- |
Constructor.
This ATM has three accounts
deposit
public void deposit(int mAccountNum,
float mAmount)
throws ATMException
- |
Tells account to deposit [amount].
- Specified by:
deposit
in interface ATM
ATMException
withdraw
public void withdraw(int mAccountNum,
float mAmount)
throws ATMException
- |
Tells account to withdraw [amount]
- Specified by:
withdraw
in interface ATM
ATMException
getBalance
public float getBalance(int mAccountNum)
throws ATMException
- |
Asks account for the balance in that account.
- Specified by:
getBalance
in interface ATM
- Returns:
- float Balance in [account]
ATMException
getAccount
public cscie160.hw5.Account getAccount(int mAccountNum)
throws ATMException
- |
Asks account for the balance in that account.
- Returns:
- float Balance in [account]
ATMException