/*This code was generated using the UMPLE modeling language!
 Date of generation: 2008/07/29 14:36:59*/
/*This class drives: */

package Police.core;

import Police.*;
import Police.json.*;

public class Person {
  //Class datatypes
  private String name;

  private String phone;

  private String sex;

  private String address;

  private String age;

  //Class association variables

  //Registry of our system.
  PoliceRegistry registry = PoliceRegistry.getInstance();

  //Constructor
  public Person(String aName, String aPhone, String aSex, String aAddress,
    String aAge) {
    name = aName;
    phone = aPhone;
    sex = aSex;
    address = aAddress;
    age = aAge;
  }

  public boolean setName(String aName) {
    name = aName;
    return true;
  }

  public boolean setPhone(String aPhone) {
    phone = aPhone;
    return true;
  }

  public boolean setSex(String aSex) {
    sex = aSex;
    return true;
  }

  public boolean setAddress(String aAddress) {
    address = aAddress;
    return true;
  }

  public boolean setAge(String aAge) {
    age = aAge;
    return true;
  }

  public String getName() {
    return name;
  }

  public String getPhone() {
    return phone;
  }

  public String getSex() {
    return sex;
  }

  public String getAddress() {
    return address;
  }

  public String getAge() {
    return age;
  }

  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("name", getName());
    obj.put("phone", getPhone());
    obj.put("sex", getSex());
    obj.put("address", getAddress());
    obj.put("age", getAge());
    return obj;
  }

}