Package src

Class RunBank

java.lang.Object
src.RunBank

public class RunBank extends Object
Driver class containg User Interface and CSV conversion to create the bank system.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static Dictionary<Integer,Customer>
    A dictionary that maps IDs to Customer objects.
    protected static Dictionary<String,Customer>
    A dictionary that maps a combined key of first name and last name to a Customer object.
    static boolean
    A flag indicating whether the customer wants to exit the application.
    protected static Dictionary<Integer,Customer>
     
    protected static Logger
    Logger instance for logging events within the class.
    static boolean
    A flag indicating whether the customer wants to return to the main menu.
    protected static List<String>
    List of names to maintain the order of the users, so that when the updatingCSVFile method is invoked, it can update the CSV file based on the order they were read
    protected static String
    titles for the updated CSV file(first line)
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    main(String[] args)
    The entry point of the application.
    static boolean
    transferHelper(String customerName, String customerName2, int fromAccount, int toAccount, double amount)
    Facilitates a transfer or payment transaction between accounts by customer names and account numbers.
    static boolean
    transferHelper(String customerName, String customerName2, String fromAccount, String toAccount, double amount)
    Facilitates a transfer or payment transaction between accounts by customer names and account types.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • customerList

      protected static Dictionary<String,Customer> customerList
      A dictionary that maps a combined key of first name and last name to a Customer object.
    • accountList

      protected static Dictionary<Integer,Customer> accountList
      A dictionary that maps IDs to Customer objects.
    • IDList

      protected static Dictionary<Integer,Customer> IDList
    • exit

      public static boolean exit
      A flag indicating whether the customer wants to exit the application.
    • names

      protected static List<String> names
      List of names to maintain the order of the users, so that when the updatingCSVFile method is invoked, it can update the CSV file based on the order they were read
    • titles

      protected static String titles
      titles for the updated CSV file(first line)
    • log

      protected static Logger log
      Logger instance for logging events within the class. This `Logger` is protected and static, allowing it to be shared across instances of this class and accessible to subclasses.
  • Constructor Details

    • RunBank

      public RunBank()
  • Method Details

    • main

      public static void main(String[] args)
      The entry point of the application. This method initializes the bank application, reads customer data from a CSV file, and runs the main banking loop.
      Parameters:
      args - Command line arguments (not used in this application).
    • transferHelper

      public static boolean transferHelper(String customerName, String customerName2, String fromAccount, String toAccount, double amount)
      Facilitates a transfer or payment transaction between accounts by customer names and account types. This method checks if both customer names are the same. If so, it transfers funds between two accounts owned by the same customer. Otherwise, it initiates a payment from one customer to another.
      Parameters:
      customerName - the name of the customer initiating the transaction
      customerName2 - the name of the receiving customer, or the same customer if transferring between accounts
      fromAccount - the type of the source account (e.g., "checking", "saving")
      toAccount - the type of the destination account
      amount - the amount to be transferred or paid
      Returns:
      true if the transaction is successful; false otherwise
    • transferHelper

      public static boolean transferHelper(String customerName, String customerName2, int fromAccount, int toAccount, double amount)
      Facilitates a transfer or payment transaction between accounts by customer names and account numbers. This method checks if both customer names are the same. If so, it transfers funds between two accounts owned by the same customer. Otherwise, it initiates a payment from one customer to another.
      Parameters:
      customerName - the name of the customer initiating the transaction
      customerName2 - the name of the receiving customer, or the same customer if transferring between accounts
      fromAccount - the account number of the source account
      toAccount - the account number of the destination account
      amount - the amount to be transferred or paid
      Returns:
      true if the transaction is successful; false otherwise