/*This code was generated using the UMPLE modeling language!
 Date of generation: 2008/07/30 12:41:46*/
/*This class drives: ReusableFinancialInstrument*/

package BankingSystem.core;

import BankingSystem.*;
import BankingSystem.json.*;

public class Currency {
  //Class datatypes
  private String code;

  private String exchangeRate;

  //Class association variables

  //Registry of our system.
  BankingSystemRegistry registry = BankingSystemRegistry.getInstance();

  //Constructor
  public Currency(String aCode, String aExchangeRate) {
    code = aCode;
    exchangeRate = aExchangeRate;
  }

  public boolean setCode(String aCode) {
    code = aCode;
    return true;
  }

  public boolean setExchangeRate(String aExchangeRate) {
    exchangeRate = aExchangeRate;
    return true;
  }

  public String getCode() {
    return code;
  }

  public String getExchangeRate() {
    return exchangeRate;
  }

  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("code", getCode());
    obj.put("exchangeRate", getExchangeRate());
    return obj;
  }

}