/*This code was generated using the UMPLE modeling language!
 Date of generation: 2008/07/30 12:30:06*/
/*This class drives: */

package BankingSystem.core.intangableResources;

import java.util.*;
import BankingSystem.*;
import BankingSystem.core.humanResources.*;
import BankingSystem.core.tangableResources.*;
import BankingSystem.json.*;

public class MortgageAccount extends Account {
  //Class datatypes
  private String collateral;

  //Class association variables

  //Registry of our system.
  BankingSystemRegistry registry = BankingSystemRegistry.getInstance();

  //Constructor
  public MortgageAccount(int aAccountNumber, Float aBalance,
    Float aCreditLimit, ArrayList<Client> clients, AccountType aAccountType,
    Branch aBranch, String aCollateral) {
    super(aAccountNumber, aBalance, aCreditLimit, clients, aAccountType,
      aBranch);
    collateral = aCollateral;
  }

  public boolean setCollateral(String aCollateral) {
    collateral = aCollateral;
    return true;
  }

  public String getCollateral() {
    return collateral;
  }

  public void delete() {
  }

  public boolean areManyEndsNull() {
    return true;
  }

  /***********************************
   * Returns the attribute list along with the  
   * class ID in JSON format.
   ***********************************/
  public JSONObject getAttributes() throws JSONException {
    JSONObject obj = new JSONObject();
    obj.put("CLASS_ID", registry.getKey(this));
    obj.put("collateral", getCollateral());
    return obj;
  }

}