/*This code was generated using the UMPLE modeling language!
 Date of generation: 2008/07/30 11:21:38*/
/*This class drives: */

package insurance.core;

import insurance.*;
import insurance.json.*;

public class Building extends InsuredProperty {
  //Class datatypes
  private String address;

  private String floorArea;

  //Class association variables

  //Registry of our system.
  InsuranceRegistry registry = InsuranceRegistry.getInstance();

  //Constructor
  public Building(String aYearBuilt,
    PropertyInsurancePolicy aPropertyInsurancePolicy, String aAddress,
    String aFloorArea) {
    super(aYearBuilt, aPropertyInsurancePolicy);
    address = aAddress;
    floorArea = aFloorArea;
  }

  public boolean setAddress(String aAddress) {
    address = aAddress;
    return true;
  }

  public boolean setFloorArea(String aFloorArea) {
    floorArea = aFloorArea;
    return true;
  }

  public String getAddress() {
    return address;
  }

  public String getFloorArea() {
    return floorArea;
  }

  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("address", getAddress());
    obj.put("floorArea", getFloorArea());
    return obj;
  }

}