java.lang.Object
com.atmbanksimulator.Controller
ATM Simulator - Controller
The Controller class acts as the nervous system of the ATM, creating connections for button press
events received from the View to the appropriate processing methods in UIModel.
It contains no business logic of its own, it solely maps user actions to UIModel instructions.
- Version:
- 3.0
- Author:
- D'Souza, C. J.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the account details fromUIModel.Retrieves the transaction history fromUIModel.protected voidprotected voidsaveChangePlan(String type, String tier, String withdrawalLimit) Forwards a plan change request toUIModelafter the user confirms their selection in the Change Plan screen.
-
Constructor Details
-
Controller
public Controller()
-
-
Method Details
-
process
Connects a button press action from theViewto the appropriate method inUIModel. Acts purely as a dispatcher or UI method mapper with no business logic.- Parameters:
action- the text label or ID of the button that was pressed
-
saveChangePlan
Forwards a plan change request toUIModelafter the user confirms their selection in the Change Plan screen.- Parameters:
type- the selected account type —"Basic"or"Student"tier- the selected account tier —"Normal","Pro", or"Prime"withdrawalLimit- the corresponding withdrawal limit as a string
-
getTransactionHistory
Retrieves the transaction history fromUIModel.- Returns:
- a list of transaction records each as a list of strings
-
getAccountDetails
Retrieves the account details fromUIModel.- Returns:
- a list of account detail strings in a fixed positional order
-