/*This code was generated using the UMPLE modeling language!
 Date of generation: 2008/07/30 13:12:55*/
/*This class drives: */

package Warehouse.core;

import java.sql.Time;
import Warehouse.*;
import Warehouse.json.*;

public class RWBM {
  //Class datatypes
  private int ID;

  //Class association variables
  private RWBMMovement rWBMMovement;

  //Registry of our system.
  WarehouseRegistry registry = WarehouseRegistry.getInstance();

  //Constructor
  public RWBM(int aID, RWBMMovement aRWBMMovement) {
    ID = aID;
    rWBMMovement = aRWBMMovement;
    rWBMMovement.addRWBM(this);

  }

  public boolean setID(int aID) {
    ID = aID;
    return true;
  }

  public int getID() {
    return ID;
  }

  public RWBMMovement getRWBMMovement() {
    return rWBMMovement;
  }

  /* This class does not drive RWBMMovement and therefore sets the association unidirectionally.*/
  public void setRWBMMovement(RWBMMovement aRWBMMovement) {
    rWBMMovement = aRWBMMovement;
  }

  public void delete() {
    //Delete all 1 ends.
    rWBMMovement.deleteRWBM(this);
  }

  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("ID", getID());
    return obj;
  }

}