Class Account

Object
Account

public abstract class Account
extends Object
This abstract class defines a BetterBanking Account object, and implements various methods to manipulate this Account.
Version:
1.0
Author:
Tristan Parry
  • Constructor Summary

    Constructors
    Constructor Description
    Account​(Document accountInfo)
    This constructor creates a BetterBanking Account with a specified account type, Client username, balance, interest rate, and file path.
  • Method Summary

    Modifier and Type Method Description
    void applyInterest()
    This mutator method calculates/applies an Account object's interest rate, and writes the resulting balances to corresponding database files
    double balance()
    This accessor method returns the Account object's accountBalanace instance field.
    void deposit​(double depositArg)
    This mutator method calculates and applies a user deposit into a BetterBanking Account.
    String getAccountType()
    This accessor method returns the Account object's accountType instance field.
    double getClientFunds()
    This accessor method returns the Account clientFunds static field.
    double getInterestRate()
    This accessor method returns the Account object's accountInterestRate instance field.
    String toString()
    This method returns a formatted String of the Account object's field values.
    void withdraw​(double withdrawArg)
    This mutator method calculates and applies a user withdrawal from a BetterBanking Account.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Account

      public Account​(Document accountInfo)
      This constructor creates a BetterBanking Account with a specified account type, Client username, balance, interest rate, and file path.
      Parameters:
      accountInfo - Document used to read the required Account parameters from an associated database file
  • Method Details

    • getAccountType

      public String getAccountType()
      This accessor method returns the Account object's accountType instance field.
      Returns:
      The Account's accountType field value
    • deposit

      public void deposit​(double depositArg)
      This mutator method calculates and applies a user deposit into a BetterBanking Account.
      Parameters:
      depositArg - Double value being deposited into the Account
    • withdraw

      public void withdraw​(double withdrawArg)
      This mutator method calculates and applies a user withdrawal from a BetterBanking Account.
      Parameters:
      withdrawArg - Double value being withdrawn from the Account
    • balance

      public double balance()
      This accessor method returns the Account object's accountBalanace instance field.
      Returns:
      The Account's accountBalanace field value
    • getInterestRate

      public double getInterestRate()
      This accessor method returns the Account object's accountInterestRate instance field.
      Returns:
      The Account's accountInterestRate field value
    • getClientFunds

      public double getClientFunds()
      This accessor method returns the Account clientFunds static field.
      Returns:
      The Account clientFunds static field value
    • applyInterest

      public void applyInterest()
      This mutator method calculates/applies an Account object's interest rate, and writes the resulting balances to corresponding database files
    • toString

      public String toString()
      This method returns a formatted String of the Account object's field values.
      Overrides:
      toString in class Object