/*This code was generated using the UMPLE modeling language! Date of generation: 2008/07/30 10:05:36*/ /*This class drives: */ package MFP.core.red; import MFP.*; import MFP.core.green.*; import MFP.core.black.*; import MFP.core.blue.*; import MFP.json.*; public class RobotAllocation { //Class datatypes private String timePeriod; //Class association variables private AssemblyStep assemblyStep; private Robot robot; //Registry of our system. MFPRegistry registry = MFPRegistry.getInstance(); //Constructor public RobotAllocation(String aTimePeriod, AssemblyStep aAssemblyStep, Robot aRobot) { timePeriod = aTimePeriod; assemblyStep = aAssemblyStep; assemblyStep.addRobotAllocation(this); robot = aRobot; robot.addRobotAllocation(this); } public boolean setTimePeriod(String aTimePeriod) { timePeriod = aTimePeriod; return true; } public String getTimePeriod() { return timePeriod; } public AssemblyStep getAssemblyStep() { return assemblyStep; } public Robot getRobot() { return robot; } /* This class does not drive AssemblyStep and therefore sets the association unidirectionally.*/ public void setAssemblyStep(AssemblyStep aAssemblyStep) { assemblyStep = aAssemblyStep; } /* This class does not drive Robot and therefore sets the association unidirectionally.*/ public void setRobot(Robot aRobot) { robot = aRobot; } public void delete() { //Delete all 1 ends. assemblyStep.deleteRobotAllocation(this); robot.deleteRobotAllocation(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("timePeriod", getTimePeriod()); return obj; } }