Class Controller

java.lang.Object
com.atmbanksimulator.Controller

public class Controller extends Object

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 Details

    • Controller

      public Controller()
  • Method Details

    • process

      protected void process(String action)
      Connects a button press action from the View to the appropriate method in UIModel. 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

      protected void saveChangePlan(String type, String tier, String withdrawalLimit)
      Forwards a plan change request to UIModel after 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

      protected ArrayList<ArrayList<String>> getTransactionHistory()
      Retrieves the transaction history from UIModel.
      Returns:
      a list of transaction records each as a list of strings
    • getAccountDetails

      protected ArrayList<String> getAccountDetails()
      Retrieves the account details from UIModel.
      Returns:
      a list of account detail strings in a fixed positional order