/*This code was generated using the UMPLE modeling language!*/ package Police; import java.sql.Time; import java.sql.Date; import java.util.ArrayList; import java.util.Iterator; import Police.json.*; import Police.core.*; public class PoliceFacade { // Singleton instance. private static PoliceFacade theInstance; //System registry. PoliceRegistry registry = PoliceRegistry.getInstance(); /** * Dummy constructor */ private PoliceFacade() { } /** * Returns the only instance of the Facade. * * @return */ public static PoliceFacade getInstance() { if (theInstance == null) theInstance = new PoliceFacade(); return theInstance; } public int constructInvestigatingOfficer(String aName, String aPhone, String aSex, String aAddress, String aAge, int aJurisdiction) { return registry.add(new InvestigatingOfficer(aName, aPhone, aSex, aAddress, aAge, (Jurisdiction) registry.getValue(aJurisdiction))); } public JSONObject constructInvestigatingOfficerJSON(String aName, String aPhone, String aSex, String aAddress, String aAge, int aJurisdiction) throws JSONException { InvestigatingOfficer contextObj = new InvestigatingOfficer(aName, aPhone, aSex, aAddress, aAge, (Jurisdiction) registry.getValue(aJurisdiction)); registry.add(contextObj); return contextObj.getAttributes(); } /************ * Method returns an iterator to the list of id's of the elements involved in this list. ***************/ public Iterator getCrimeOccurrencesFromInvestigatingOfficer(int context) { ArrayList listOfIDs = new ArrayList(); for (CrimeOccurrence obj : ((InvestigatingOfficer) registry .getValue(context)).getCrimeOccurrences()) { listOfIDs.add(registry.getKey(obj)); } return listOfIDs.iterator(); } public int getJurisdictionFromInvestigatingOfficer(int context) { return registry.getKey(((InvestigatingOfficer) registry.getValue(context)) .getJurisdiction()); } public JSONObject getJurisdictionFromInvestigatingOfficerJSON(int context) throws JSONException { return ((InvestigatingOfficer) registry.getValue(context)) .getJurisdiction().getAttributes(); } public int addCrimeOccurrenceToInvestigatingOfficer(int context, String aLocation, String aDate, String aTime, String aDescription) throws Exception { return registry.getKey(((InvestigatingOfficer) registry.getValue(context)) .addCrimeOccurrence(aLocation, aDate, aTime, aDescription)); } public JSONObject addCrimeOccurrenceToInvestigatingOfficerJSON(int context, String aLocation, String aDate, String aTime, String aDescription) throws JSONException, Exception { return ((InvestigatingOfficer) registry.getValue(context)) .addCrimeOccurrence(aLocation, aDate, aTime, aDescription) .getAttributes(); } public int addCrimeOccurrenceToInvestigatingOfficerOnly(int context, int aCrimeOccurrence) throws Exception { return registry .getKey(((InvestigatingOfficer) registry.getValue(context)) .addCrimeOccurrence((CrimeOccurrence) registry .getValue(aCrimeOccurrence))); } public JSONObject addCrimeOccurrenceToInvestigatingOfficerOnlyJSON( int context, int aCrimeOccurrence) throws JSONException, Exception { return ((InvestigatingOfficer) registry.getValue(context)) .addCrimeOccurrence((CrimeOccurrence) registry.getValue(aCrimeOccurrence)) .getAttributes(); } public void setJurisdictionInInvestigatingOfficer(int context, int aJurisdiction) throws Exception { ((InvestigatingOfficer) registry.getValue(context)) .setJurisdiction((Jurisdiction) registry.getValue(aJurisdiction)); } public void deleteInvestigatingOfficer(int context) { ((InvestigatingOfficer) registry.getValue(context)).delete(); registry.removeObj(context); } public void deleteCrimeOccurrenceFromInvestigatingOfficer(int context, int aCrimeOccurrence) { ((InvestigatingOfficer) registry.getValue(context)) .deleteCrimeOccurrence((CrimeOccurrence) registry .getValue(aCrimeOccurrence)); } public JSONObject getAttributesOfInvestigatingOfficer(int context) throws JSONException { return ((InvestigatingOfficer) registry.getValue(context)).getAttributes(); } public int constructWitness(String aName, String aPhone, String aSex, String aAddress, String aAge, String aStatement) { return registry.add(new Witness(aName, aPhone, aSex, aAddress, aAge, aStatement)); } public JSONObject constructWitnessJSON(String aName, String aPhone, String aSex, String aAddress, String aAge, String aStatement) throws JSONException { Witness contextObj = new Witness(aName, aPhone, aSex, aAddress, aAge, aStatement); registry.add(contextObj); return contextObj.getAttributes(); } public boolean setStatementInWitness(int context, String aStatement) { return ((Witness) registry.getValue(context)).setStatement(aStatement); } public String getStatementFromWitness(int context) { return ((Witness) registry.getValue(context)).getStatement(); } /************ * Method returns an iterator to the list of id's of the elements involved in this list. ***************/ public Iterator getCrimeOccurrencesFromWitness(int context) { ArrayList listOfIDs = new ArrayList(); for (CrimeOccurrence obj : ((Witness) registry.getValue(context)) .getCrimeOccurrences()) { listOfIDs.add(registry.getKey(obj)); } return listOfIDs.iterator(); } /************ * Method returns an iterator to the list of id's of the elements involved in this list. ***************/ public Iterator getSuspectDescriptionsFromWitness(int context) { ArrayList listOfIDs = new ArrayList(); for (SuspectDescription obj : ((Witness) registry.getValue(context)) .getSuspectDescriptions()) { listOfIDs.add(registry.getKey(obj)); } return listOfIDs.iterator(); } public int addCrimeOccurrenceToWitness(int context, String aLocation, String aDate, String aTime, String aDescription) throws Exception { return registry.getKey(((Witness) registry.getValue(context)) .addCrimeOccurrence(aLocation, aDate, aTime, aDescription)); } public JSONObject addCrimeOccurrenceToWitnessJSON(int context, String aLocation, String aDate, String aTime, String aDescription) throws JSONException, Exception { return ((Witness) registry.getValue(context)).addCrimeOccurrence(aLocation, aDate, aTime, aDescription).getAttributes(); } public int addCrimeOccurrenceToWitnessOnly(int context, int aCrimeOccurrence) throws Exception { return registry .getKey(((Witness) registry.getValue(context)) .addCrimeOccurrence((CrimeOccurrence) registry .getValue(aCrimeOccurrence))); } public JSONObject addCrimeOccurrenceToWitnessOnlyJSON(int context, int aCrimeOccurrence) throws JSONException, Exception { return ((Witness) registry.getValue(context)).addCrimeOccurrence( (CrimeOccurrence) registry.getValue(aCrimeOccurrence)).getAttributes(); } public int addSuspectDescriptionToWitness(int context, String aHeight, String aWeight, String aBuild, String aColour, String aHairCharacteristics, String aFacialCharacteristics, String aOtherDetails) throws Exception { return registry.getKey(((Witness) registry.getValue(context)) .addSuspectDescription(aHeight, aWeight, aBuild, aColour, aHairCharacteristics, aFacialCharacteristics, aOtherDetails)); } public JSONObject addSuspectDescriptionToWitnessJSON(int context, String aHeight, String aWeight, String aBuild, String aColour, String aHairCharacteristics, String aFacialCharacteristics, String aOtherDetails) throws JSONException, Exception { return ((Witness) registry.getValue(context)).addSuspectDescription( aHeight, aWeight, aBuild, aColour, aHairCharacteristics, aFacialCharacteristics, aOtherDetails).getAttributes(); } public int addSuspectDescriptionToWitnessOnly(int context, int aSuspectDescription) throws Exception { return registry.getKey(((Witness) registry.getValue(context)) .addSuspectDescription((SuspectDescription) registry .getValue(aSuspectDescription))); } public JSONObject addSuspectDescriptionToWitnessOnlyJSON(int context, int aSuspectDescription) throws JSONException, Exception { return ((Witness) registry.getValue(context)).addSuspectDescription( (SuspectDescription) registry.getValue(aSuspectDescription)) .getAttributes(); } public void deleteWitness(int context) { ((Witness) registry.getValue(context)).delete(); registry.removeObj(context); } public void deleteCrimeOccurrenceFromWitness(int context, int aCrimeOccurrence) { ((Witness) registry.getValue(context)) .deleteCrimeOccurrence((CrimeOccurrence) registry .getValue(aCrimeOccurrence)); } public void deleteSuspectDescriptionFromWitness(int context, int aSuspectDescription) { ((Witness) registry.getValue(context)) .deleteSuspectDescription((SuspectDescription) registry .getValue(aSuspectDescription)); } public JSONObject getAttributesOfWitness(int context) throws JSONException { return ((Witness) registry.getValue(context)).getAttributes(); } public int constructVictim(String aName, String aPhone, String aSex, String aAddress, String aAge, String aInjurySuffered) { return registry.add(new Victim(aName, aPhone, aSex, aAddress, aAge, aInjurySuffered)); } public JSONObject constructVictimJSON(String aName, String aPhone, String aSex, String aAddress, String aAge, String aInjurySuffered) throws JSONException { Victim contextObj = new Victim(aName, aPhone, aSex, aAddress, aAge, aInjurySuffered); registry.add(contextObj); return contextObj.getAttributes(); } public boolean setInjurySufferedInVictim(int context, String aInjurySuffered) { return ((Victim) registry.getValue(context)) .setInjurySuffered(aInjurySuffered); } public String getInjurySufferedFromVictim(int context) { return ((Victim) registry.getValue(context)).getInjurySuffered(); } /************ * Method returns an iterator to the list of id's of the elements involved in this list. ***************/ public Iterator getCrimeOccurrencesFromVictim(int context) { ArrayList listOfIDs = new ArrayList(); for (CrimeOccurrence obj : ((Victim) registry.getValue(context)) .getCrimeOccurrences()) { listOfIDs.add(registry.getKey(obj)); } return listOfIDs.iterator(); } public int addCrimeOccurrenceToVictim(int context, String aLocation, String aDate, String aTime, String aDescription) throws Exception { return registry.getKey(((Victim) registry.getValue(context)) .addCrimeOccurrence(aLocation, aDate, aTime, aDescription)); } public JSONObject addCrimeOccurrenceToVictimJSON(int context, String aLocation, String aDate, String aTime, String aDescription) throws JSONException, Exception { return ((Victim) registry.getValue(context)).addCrimeOccurrence(aLocation, aDate, aTime, aDescription).getAttributes(); } public int addCrimeOccurrenceToVictimOnly(int context, int aCrimeOccurrence) throws Exception { return registry .getKey(((Victim) registry.getValue(context)) .addCrimeOccurrence((CrimeOccurrence) registry .getValue(aCrimeOccurrence))); } public JSONObject addCrimeOccurrenceToVictimOnlyJSON(int context, int aCrimeOccurrence) throws JSONException, Exception { return ((Victim) registry.getValue(context)).addCrimeOccurrence( (CrimeOccurrence) registry.getValue(aCrimeOccurrence)).getAttributes(); } public void deleteVictim(int context) { ((Victim) registry.getValue(context)).delete(); registry.removeObj(context); } public void deleteCrimeOccurrenceFromVictim(int context, int aCrimeOccurrence) { ((Victim) registry.getValue(context)) .deleteCrimeOccurrence((CrimeOccurrence) registry .getValue(aCrimeOccurrence)); } public JSONObject getAttributesOfVictim(int context) throws JSONException { return ((Victim) registry.getValue(context)).getAttributes(); } public int constructSuspect(String aName, String aPhone, String aSex, String aAddress, String aAge, String aStatement) { return registry.add(new Suspect(aName, aPhone, aSex, aAddress, aAge, aStatement)); } public JSONObject constructSuspectJSON(String aName, String aPhone, String aSex, String aAddress, String aAge, String aStatement) throws JSONException { Suspect contextObj = new Suspect(aName, aPhone, aSex, aAddress, aAge, aStatement); registry.add(contextObj); return contextObj.getAttributes(); } public boolean setStatementInSuspect(int context, String aStatement) { return ((Suspect) registry.getValue(context)).setStatement(aStatement); } public String getStatementFromSuspect(int context) { return ((Suspect) registry.getValue(context)).getStatement(); } /************ * Method returns an iterator to the list of id's of the elements involved in this list. ***************/ public Iterator getCrimeOccurrencesFromSuspect(int context) { ArrayList listOfIDs = new ArrayList(); for (CrimeOccurrence obj : ((Suspect) registry.getValue(context)) .getCrimeOccurrences()) { listOfIDs.add(registry.getKey(obj)); } return listOfIDs.iterator(); } /************ * Method returns an iterator to the list of id's of the elements involved in this list. ***************/ public Iterator getChargeOccurrencesFromSuspect(int context) { ArrayList listOfIDs = new ArrayList(); for (ChargeOccurrence obj : ((Suspect) registry.getValue(context)) .getChargeOccurrences()) { listOfIDs.add(registry.getKey(obj)); } return listOfIDs.iterator(); } /************ * Method returns an iterator to the list of id's of the elements involved in this list. ***************/ public Iterator getSuspectDescriptionsFromSuspect(int context) { ArrayList listOfIDs = new ArrayList(); for (SuspectDescription obj : ((Suspect) registry.getValue(context)) .getSuspectDescriptions()) { listOfIDs.add(registry.getKey(obj)); } return listOfIDs.iterator(); } public int addCrimeOccurrenceToSuspect(int context, String aLocation, String aDate, String aTime, String aDescription) throws Exception { return registry.getKey(((Suspect) registry.getValue(context)) .addCrimeOccurrence(aLocation, aDate, aTime, aDescription)); } public JSONObject addCrimeOccurrenceToSuspectJSON(int context, String aLocation, String aDate, String aTime, String aDescription) throws JSONException, Exception { return ((Suspect) registry.getValue(context)).addCrimeOccurrence(aLocation, aDate, aTime, aDescription).getAttributes(); } public int addCrimeOccurrenceToSuspectOnly(int context, int aCrimeOccurrence) throws Exception { return registry .getKey(((Suspect) registry.getValue(context)) .addCrimeOccurrence((CrimeOccurrence) registry .getValue(aCrimeOccurrence))); } public JSONObject addCrimeOccurrenceToSuspectOnlyJSON(int context, int aCrimeOccurrence) throws JSONException, Exception { return ((Suspect) registry.getValue(context)).addCrimeOccurrence( (CrimeOccurrence) registry.getValue(aCrimeOccurrence)).getAttributes(); } public int addChargeOccurrenceToSuspect(int context, String aDateEntered, String aDisposition, String aPenalty, int aOffenseType) throws Exception { return registry.getKey(((Suspect) registry.getValue(context)) .addChargeOccurrence(aDateEntered, aDisposition, aPenalty, (OffenseType) registry.getValue(aOffenseType))); } public JSONObject addChargeOccurrenceToSuspectJSON(int context, String aDateEntered, String aDisposition, String aPenalty, int aOffenseType) throws JSONException, Exception { return ((Suspect) registry.getValue(context)).addChargeOccurrence( aDateEntered, aDisposition, aPenalty, (OffenseType) registry.getValue(aOffenseType)).getAttributes(); } public int addChargeOccurrenceToSuspectOnly(int context, int aChargeOccurrence) throws Exception { return registry.getKey(((Suspect) registry.getValue(context)) .addChargeOccurrence((ChargeOccurrence) registry .getValue(aChargeOccurrence))); } public JSONObject addChargeOccurrenceToSuspectOnlyJSON(int context, int aChargeOccurrence) throws JSONException, Exception { return ((Suspect) registry.getValue(context)).addChargeOccurrence( (ChargeOccurrence) registry.getValue(aChargeOccurrence)).getAttributes(); } public int addSuspectDescriptionToSuspect(int context, String aHeight, String aWeight, String aBuild, String aColour, String aHairCharacteristics, String aFacialCharacteristics, String aOtherDetails, int aDescribedBy) throws Exception { return registry.getKey(((Suspect) registry.getValue(context)) .addSuspectDescription(aHeight, aWeight, aBuild, aColour, aHairCharacteristics, aFacialCharacteristics, aOtherDetails, (Witness) registry.getValue(aDescribedBy))); } public JSONObject addSuspectDescriptionToSuspectJSON(int context, String aHeight, String aWeight, String aBuild, String aColour, String aHairCharacteristics, String aFacialCharacteristics, String aOtherDetails, int aDescribedBy) throws JSONException, Exception { return ((Suspect) registry.getValue(context)).addSuspectDescription( aHeight, aWeight, aBuild, aColour, aHairCharacteristics, aFacialCharacteristics, aOtherDetails, (Witness) registry.getValue(aDescribedBy)).getAttributes(); } public int addSuspectDescriptionToSuspectOnly(int context, int aSuspectDescription) throws Exception { return registry.getKey(((Suspect) registry.getValue(context)) .addSuspectDescription((SuspectDescription) registry .getValue(aSuspectDescription))); } public JSONObject addSuspectDescriptionToSuspectOnlyJSON(int context, int aSuspectDescription) throws JSONException, Exception { return ((Suspect) registry.getValue(context)).addSuspectDescription( (SuspectDescription) registry.getValue(aSuspectDescription)) .getAttributes(); } public void deleteSuspect(int context) { ((Suspect) registry.getValue(context)).delete(); registry.removeObj(context); } public void deleteCrimeOccurrenceFromSuspect(int context, int aCrimeOccurrence) { ((Suspect) registry.getValue(context)) .deleteCrimeOccurrence((CrimeOccurrence) registry .getValue(aCrimeOccurrence)); } public void deleteChargeOccurrenceFromSuspect(int context, int aChargeOccurrence) { ((Suspect) registry.getValue(context)) .deleteChargeOccurrence((ChargeOccurrence) registry .getValue(aChargeOccurrence)); } public void deleteSuspectDescriptionFromSuspect(int context, int aSuspectDescription) { ((Suspect) registry.getValue(context)) .deleteSuspectDescription((SuspectDescription) registry .getValue(aSuspectDescription)); } public JSONObject getAttributesOfSuspect(int context) throws JSONException { return ((Suspect) registry.getValue(context)).getAttributes(); } public int constructPerson(String aName, String aPhone, String aSex, String aAddress, String aAge) { return registry.add(new Person(aName, aPhone, aSex, aAddress, aAge)); } public JSONObject constructPersonJSON(String aName, String aPhone, String aSex, String aAddress, String aAge) throws JSONException { Person contextObj = new Person(aName, aPhone, aSex, aAddress, aAge); registry.add(contextObj); return contextObj.getAttributes(); } public boolean setNameInPerson(int context, String aName) { return ((Person) registry.getValue(context)).setName(aName); } public boolean setPhoneInPerson(int context, String aPhone) { return ((Person) registry.getValue(context)).setPhone(aPhone); } public boolean setSexInPerson(int context, String aSex) { return ((Person) registry.getValue(context)).setSex(aSex); } public boolean setAddressInPerson(int context, String aAddress) { return ((Person) registry.getValue(context)).setAddress(aAddress); } public boolean setAgeInPerson(int context, String aAge) { return ((Person) registry.getValue(context)).setAge(aAge); } public String getNameFromPerson(int context) { return ((Person) registry.getValue(context)).getName(); } public String getPhoneFromPerson(int context) { return ((Person) registry.getValue(context)).getPhone(); } public String getSexFromPerson(int context) { return ((Person) registry.getValue(context)).getSex(); } public String getAddressFromPerson(int context) { return ((Person) registry.getValue(context)).getAddress(); } public String getAgeFromPerson(int context) { return ((Person) registry.getValue(context)).getAge(); } public void deletePerson(int context) { ((Person) registry.getValue(context)).delete(); registry.removeObj(context); } public JSONObject getAttributesOfPerson(int context) throws JSONException { return ((Person) registry.getValue(context)).getAttributes(); } public int constructSuspectDescription(String aHeight, String aWeight, String aBuild, String aColour, String aHairCharacteristics, String aFacialCharacteristics, String aOtherDetails, int aDescribedBy) { return registry.add(new SuspectDescription(aHeight, aWeight, aBuild, aColour, aHairCharacteristics, aFacialCharacteristics, aOtherDetails, (Witness) registry.getValue(aDescribedBy))); } public JSONObject constructSuspectDescriptionJSON(String aHeight, String aWeight, String aBuild, String aColour, String aHairCharacteristics, String aFacialCharacteristics, String aOtherDetails, int aDescribedBy) throws JSONException { SuspectDescription contextObj = new SuspectDescription(aHeight, aWeight, aBuild, aColour, aHairCharacteristics, aFacialCharacteristics, aOtherDetails, (Witness) registry.getValue(aDescribedBy)); registry.add(contextObj); return contextObj.getAttributes(); } public boolean setHeightInSuspectDescription(int context, String aHeight) { return ((SuspectDescription) registry.getValue(context)).setHeight(aHeight); } public boolean setWeightInSuspectDescription(int context, String aWeight) { return ((SuspectDescription) registry.getValue(context)).setWeight(aWeight); } public boolean setBuildInSuspectDescription(int context, String aBuild) { return ((SuspectDescription) registry.getValue(context)).setBuild(aBuild); } public boolean setColourInSuspectDescription(int context, String aColour) { return ((SuspectDescription) registry.getValue(context)).setColour(aColour); } public boolean setHairCharacteristicsInSuspectDescription(int context, String aHairCharacteristics) { return ((SuspectDescription) registry.getValue(context)) .setHairCharacteristics(aHairCharacteristics); } public boolean setFacialCharacteristicsInSuspectDescription(int context, String aFacialCharacteristics) { return ((SuspectDescription) registry.getValue(context)) .setFacialCharacteristics(aFacialCharacteristics); } public boolean setOtherDetailsInSuspectDescription(int context, String aOtherDetails) { return ((SuspectDescription) registry.getValue(context)) .setOtherDetails(aOtherDetails); } public String getHeightFromSuspectDescription(int context) { return ((SuspectDescription) registry.getValue(context)).getHeight(); } public String getWeightFromSuspectDescription(int context) { return ((SuspectDescription) registry.getValue(context)).getWeight(); } public String getBuildFromSuspectDescription(int context) { return ((SuspectDescription) registry.getValue(context)).getBuild(); } public String getColourFromSuspectDescription(int context) { return ((SuspectDescription) registry.getValue(context)).getColour(); } public String getHairCharacteristicsFromSuspectDescription(int context) { return ((SuspectDescription) registry.getValue(context)) .getHairCharacteristics(); } public String getFacialCharacteristicsFromSuspectDescription(int context) { return ((SuspectDescription) registry.getValue(context)) .getFacialCharacteristics(); } public String getOtherDetailsFromSuspectDescription(int context) { return ((SuspectDescription) registry.getValue(context)).getOtherDetails(); } /************ * Method returns an iterator to the list of id's of the elements involved in this list. ***************/ public Iterator getMatchessFromSuspectDescription(int context) { ArrayList listOfIDs = new ArrayList(); for (Suspect obj : ((SuspectDescription) registry.getValue(context)) .getMatchess()) { listOfIDs.add(registry.getKey(obj)); } return listOfIDs.iterator(); } public int getDescribedByFromSuspectDescription(int context) { return registry.getKey(((SuspectDescription) registry.getValue(context)) .getDescribedBy()); } public JSONObject getDescribedByFromSuspectDescriptionJSON(int context) throws JSONException { return ((SuspectDescription) registry.getValue(context)).getDescribedBy() .getAttributes(); } public int addMatchesToSuspectDescription(int context, String aName, String aPhone, String aSex, String aAddress, String aAge, String aStatement) throws Exception { return registry.getKey(((SuspectDescription) registry.getValue(context)) .addMatches(aName, aPhone, aSex, aAddress, aAge, aStatement)); } public JSONObject addMatchesToSuspectDescriptionJSON(int context, String aName, String aPhone, String aSex, String aAddress, String aAge, String aStatement) throws JSONException, Exception { return ((SuspectDescription) registry.getValue(context)).addMatches(aName, aPhone, aSex, aAddress, aAge, aStatement).getAttributes(); } public int addMatchesToSuspectDescriptionOnly(int context, int aMatches) throws Exception { return registry.getKey(((SuspectDescription) registry.getValue(context)) .addMatches((Suspect) registry.getValue(aMatches))); } public JSONObject addMatchesToSuspectDescriptionOnlyJSON(int context, int aMatches) throws JSONException, Exception { return ((SuspectDescription) registry.getValue(context)).addMatches( (Suspect) registry.getValue(aMatches)).getAttributes(); } public void setDescribedByInSuspectDescription(int context, int aDescribedBy) throws Exception { ((SuspectDescription) registry.getValue(context)) .setDescribedBy((Witness) registry.getValue(aDescribedBy)); } public void deleteSuspectDescription(int context) { ((SuspectDescription) registry.getValue(context)).delete(); registry.removeObj(context); } public void deleteMatchesFromSuspectDescription(int context, int aSuspect) { ((SuspectDescription) registry.getValue(context)) .deleteMatches((Suspect) registry.getValue(aSuspect)); } public JSONObject getAttributesOfSuspectDescription(int context) throws JSONException { return ((SuspectDescription) registry.getValue(context)).getAttributes(); } public int constructChargeOccurrence(String aDateEntered, String aDisposition, String aPenalty, int aOffenseType, int aSuspect) { return registry.add(new ChargeOccurrence(aDateEntered, aDisposition, aPenalty, (OffenseType) registry.getValue(aOffenseType), (Suspect) registry.getValue(aSuspect))); } public JSONObject constructChargeOccurrenceJSON(String aDateEntered, String aDisposition, String aPenalty, int aOffenseType, int aSuspect) throws JSONException { ChargeOccurrence contextObj = new ChargeOccurrence(aDateEntered, aDisposition, aPenalty, (OffenseType) registry.getValue(aOffenseType), (Suspect) registry .getValue(aSuspect)); registry.add(contextObj); return contextObj.getAttributes(); } public boolean setDateEnteredInChargeOccurrence(int context, String aDateEntered) { return ((ChargeOccurrence) registry.getValue(context)) .setDateEntered(aDateEntered); } public boolean setDispositionInChargeOccurrence(int context, String aDisposition) { return ((ChargeOccurrence) registry.getValue(context)) .setDisposition(aDisposition); } public boolean setPenaltyInChargeOccurrence(int context, String aPenalty) { return ((ChargeOccurrence) registry.getValue(context)).setPenalty(aPenalty); } public String getDateEnteredFromChargeOccurrence(int context) { return ((ChargeOccurrence) registry.getValue(context)).getDateEntered(); } public String getDispositionFromChargeOccurrence(int context) { return ((ChargeOccurrence) registry.getValue(context)).getDisposition(); } public String getPenaltyFromChargeOccurrence(int context) { return ((ChargeOccurrence) registry.getValue(context)).getPenalty(); } public int getOffenseTypeFromChargeOccurrence(int context) { return registry.getKey(((ChargeOccurrence) registry.getValue(context)) .getOffenseType()); } public JSONObject getOffenseTypeFromChargeOccurrenceJSON(int context) throws JSONException { return ((ChargeOccurrence) registry.getValue(context)).getOffenseType() .getAttributes(); } /************ * Method returns an iterator to the list of id's of the elements involved in this list. ***************/ public Iterator getCrimeOccurrencesFromChargeOccurrence(int context) { ArrayList listOfIDs = new ArrayList(); for (CrimeOccurrence obj : ((ChargeOccurrence) registry.getValue(context)) .getCrimeOccurrences()) { listOfIDs.add(registry.getKey(obj)); } return listOfIDs.iterator(); } public int getSuspectFromChargeOccurrence(int context) { return registry.getKey(((ChargeOccurrence) registry.getValue(context)) .getSuspect()); } public JSONObject getSuspectFromChargeOccurrenceJSON(int context) throws JSONException { return ((ChargeOccurrence) registry.getValue(context)).getSuspect() .getAttributes(); } public int addCrimeOccurrenceToChargeOccurrence(int context, String aLocation, String aDate, String aTime, String aDescription) throws Exception { return registry.getKey(((ChargeOccurrence) registry.getValue(context)) .addCrimeOccurrence(aLocation, aDate, aTime, aDescription)); } public JSONObject addCrimeOccurrenceToChargeOccurrenceJSON(int context, String aLocation, String aDate, String aTime, String aDescription) throws JSONException, Exception { return ((ChargeOccurrence) registry.getValue(context)).addCrimeOccurrence( aLocation, aDate, aTime, aDescription).getAttributes(); } public int addCrimeOccurrenceToChargeOccurrenceOnly(int context, int aCrimeOccurrence) throws Exception { return registry .getKey(((ChargeOccurrence) registry.getValue(context)) .addCrimeOccurrence((CrimeOccurrence) registry .getValue(aCrimeOccurrence))); } public JSONObject addCrimeOccurrenceToChargeOccurrenceOnlyJSON(int context, int aCrimeOccurrence) throws JSONException, Exception { return ((ChargeOccurrence) registry.getValue(context)).addCrimeOccurrence( (CrimeOccurrence) registry.getValue(aCrimeOccurrence)).getAttributes(); } public void setOffenseTypeInChargeOccurrence(int context, int aOffenseType) throws Exception { ((ChargeOccurrence) registry.getValue(context)) .setOffenseType((OffenseType) registry.getValue(aOffenseType)); } public void setSuspectInChargeOccurrence(int context, int aSuspect) throws Exception { ((ChargeOccurrence) registry.getValue(context)) .setSuspect((Suspect) registry.getValue(aSuspect)); } public void deleteChargeOccurrence(int context) { ((ChargeOccurrence) registry.getValue(context)).delete(); registry.removeObj(context); } public void deleteCrimeOccurrenceFromChargeOccurrence(int context, int aCrimeOccurrence) { ((ChargeOccurrence) registry.getValue(context)) .deleteCrimeOccurrence((CrimeOccurrence) registry .getValue(aCrimeOccurrence)); } public JSONObject getAttributesOfChargeOccurrence(int context) throws JSONException { return ((ChargeOccurrence) registry.getValue(context)).getAttributes(); } public int constructOffenseType(String aName, String aDescription, String aAct, String aSection, String aMaxPenalty) { return registry.add(new OffenseType(aName, aDescription, aAct, aSection, aMaxPenalty)); } public JSONObject constructOffenseTypeJSON(String aName, String aDescription, String aAct, String aSection, String aMaxPenalty) throws JSONException { OffenseType contextObj = new OffenseType(aName, aDescription, aAct, aSection, aMaxPenalty); registry.add(contextObj); return contextObj.getAttributes(); } public boolean setNameInOffenseType(int context, String aName) { return ((OffenseType) registry.getValue(context)).setName(aName); } public boolean setDescriptionInOffenseType(int context, String aDescription) { return ((OffenseType) registry.getValue(context)) .setDescription(aDescription); } public boolean setActInOffenseType(int context, String aAct) { return ((OffenseType) registry.getValue(context)).setAct(aAct); } public boolean setSectionInOffenseType(int context, String aSection) { return ((OffenseType) registry.getValue(context)).setSection(aSection); } public boolean setMaxPenaltyInOffenseType(int context, String aMaxPenalty) { return ((OffenseType) registry.getValue(context)) .setMaxPenalty(aMaxPenalty); } public String getNameFromOffenseType(int context) { return ((OffenseType) registry.getValue(context)).getName(); } public String getDescriptionFromOffenseType(int context) { return ((OffenseType) registry.getValue(context)).getDescription(); } public String getActFromOffenseType(int context) { return ((OffenseType) registry.getValue(context)).getAct(); } public String getSectionFromOffenseType(int context) { return ((OffenseType) registry.getValue(context)).getSection(); } public String getMaxPenaltyFromOffenseType(int context) { return ((OffenseType) registry.getValue(context)).getMaxPenalty(); } /************ * Method returns an iterator to the list of id's of the elements involved in this list. ***************/ public Iterator getChargeOccurrencesFromOffenseType(int context) { ArrayList listOfIDs = new ArrayList(); for (ChargeOccurrence obj : ((OffenseType) registry.getValue(context)) .getChargeOccurrences()) { listOfIDs.add(registry.getKey(obj)); } return listOfIDs.iterator(); } public int addChargeOccurrenceToOffenseType(int context, String aDateEntered, String aDisposition, String aPenalty, int aSuspect) throws Exception { return registry.getKey(((OffenseType) registry.getValue(context)) .addChargeOccurrence(aDateEntered, aDisposition, aPenalty, (Suspect) registry.getValue(aSuspect))); } public JSONObject addChargeOccurrenceToOffenseTypeJSON(int context, String aDateEntered, String aDisposition, String aPenalty, int aSuspect) throws JSONException, Exception { return ((OffenseType) registry.getValue(context)).addChargeOccurrence( aDateEntered, aDisposition, aPenalty, (Suspect) registry.getValue(aSuspect)).getAttributes(); } public int addChargeOccurrenceToOffenseTypeOnly(int context, int aChargeOccurrence) throws Exception { return registry.getKey(((OffenseType) registry.getValue(context)) .addChargeOccurrence((ChargeOccurrence) registry .getValue(aChargeOccurrence))); } public JSONObject addChargeOccurrenceToOffenseTypeOnlyJSON(int context, int aChargeOccurrence) throws JSONException, Exception { return ((OffenseType) registry.getValue(context)).addChargeOccurrence( (ChargeOccurrence) registry.getValue(aChargeOccurrence)).getAttributes(); } public void deleteOffenseType(int context) { ((OffenseType) registry.getValue(context)).delete(); registry.removeObj(context); } public void deleteChargeOccurrenceFromOffenseType(int context, int aChargeOccurrence) { ((OffenseType) registry.getValue(context)) .deleteChargeOccurrence((ChargeOccurrence) registry .getValue(aChargeOccurrence)); } public JSONObject getAttributesOfOffenseType(int context) throws JSONException { return ((OffenseType) registry.getValue(context)).getAttributes(); } public int constructCrimeOccurrence(String aLocation, String aDate, String aTime, String aDescription) { return registry.add(new CrimeOccurrence(aLocation, aDate, aTime, aDescription)); } public JSONObject constructCrimeOccurrenceJSON(String aLocation, String aDate, String aTime, String aDescription) throws JSONException { CrimeOccurrence contextObj = new CrimeOccurrence(aLocation, aDate, aTime, aDescription); registry.add(contextObj); return contextObj.getAttributes(); } public boolean setLocationInCrimeOccurrence(int context, String aLocation) { return ((CrimeOccurrence) registry.getValue(context)) .setLocation(aLocation); } public boolean setDateInCrimeOccurrence(int context, String aDate) { return ((CrimeOccurrence) registry.getValue(context)).setDate(aDate); } public boolean setTimeInCrimeOccurrence(int context, String aTime) { return ((CrimeOccurrence) registry.getValue(context)).setTime(aTime); } public boolean setDescriptionInCrimeOccurrence(int context, String aDescription) { return ((CrimeOccurrence) registry.getValue(context)) .setDescription(aDescription); } public String getLocationFromCrimeOccurrence(int context) { return ((CrimeOccurrence) registry.getValue(context)).getLocation(); } public String getDateFromCrimeOccurrence(int context) { return ((CrimeOccurrence) registry.getValue(context)).getDate(); } public String getTimeFromCrimeOccurrence(int context) { return ((CrimeOccurrence) registry.getValue(context)).getTime(); } public String getDescriptionFromCrimeOccurrence(int context) { return ((CrimeOccurrence) registry.getValue(context)).getDescription(); } /************ * Method returns an iterator to the list of id's of the elements involved in this list. ***************/ public Iterator getChargeOccurrencesFromCrimeOccurrence(int context) { ArrayList listOfIDs = new ArrayList(); for (ChargeOccurrence obj : ((CrimeOccurrence) registry.getValue(context)) .getChargeOccurrences()) { listOfIDs.add(registry.getKey(obj)); } return listOfIDs.iterator(); } /************ * Method returns an iterator to the list of id's of the elements involved in this list. ***************/ public Iterator getSuspectsFromCrimeOccurrence(int context) { ArrayList listOfIDs = new ArrayList(); for (Suspect obj : ((CrimeOccurrence) registry.getValue(context)) .getSuspects()) { listOfIDs.add(registry.getKey(obj)); } return listOfIDs.iterator(); } /************ * Method returns an iterator to the list of id's of the elements involved in this list. ***************/ public Iterator getWitnesssFromCrimeOccurrence(int context) { ArrayList listOfIDs = new ArrayList(); for (Witness obj : ((CrimeOccurrence) registry.getValue(context)) .getWitnesss()) { listOfIDs.add(registry.getKey(obj)); } return listOfIDs.iterator(); } /************ * Method returns an iterator to the list of id's of the elements involved in this list. ***************/ public Iterator getVictimsFromCrimeOccurrence(int context) { ArrayList listOfIDs = new ArrayList(); for (Victim obj : ((CrimeOccurrence) registry.getValue(context)) .getVictims()) { listOfIDs.add(registry.getKey(obj)); } return listOfIDs.iterator(); } /************ * Method returns an iterator to the list of id's of the elements involved in this list. ***************/ public Iterator getInvestigatingOfficersFromCrimeOccurrence(int context) { ArrayList listOfIDs = new ArrayList(); for (InvestigatingOfficer obj : ((CrimeOccurrence) registry .getValue(context)).getInvestigatingOfficers()) { listOfIDs.add(registry.getKey(obj)); } return listOfIDs.iterator(); } /************ * Method returns an iterator to the list of id's of the elements involved in this list. ***************/ public Iterator getJurisdictionsFromCrimeOccurrence(int context) { ArrayList listOfIDs = new ArrayList(); for (Jurisdiction obj : ((CrimeOccurrence) registry.getValue(context)) .getJurisdictions()) { listOfIDs.add(registry.getKey(obj)); } return listOfIDs.iterator(); } public int addChargeOccurrenceToCrimeOccurrence(int context, String aDateEntered, String aDisposition, String aPenalty, int aOffenseType, int aSuspect) throws Exception { return registry.getKey(((CrimeOccurrence) registry.getValue(context)) .addChargeOccurrence(aDateEntered, aDisposition, aPenalty, (OffenseType) registry.getValue(aOffenseType), (Suspect) registry .getValue(aSuspect))); } public JSONObject addChargeOccurrenceToCrimeOccurrenceJSON(int context, String aDateEntered, String aDisposition, String aPenalty, int aOffenseType, int aSuspect) throws JSONException, Exception { return ((CrimeOccurrence) registry.getValue(context)).addChargeOccurrence( aDateEntered, aDisposition, aPenalty, (OffenseType) registry.getValue(aOffenseType), (Suspect) registry.getValue(aSuspect)).getAttributes(); } public int addChargeOccurrenceToCrimeOccurrenceOnly(int context, int aChargeOccurrence) throws Exception { return registry.getKey(((CrimeOccurrence) registry.getValue(context)) .addChargeOccurrence((ChargeOccurrence) registry .getValue(aChargeOccurrence))); } public JSONObject addChargeOccurrenceToCrimeOccurrenceOnlyJSON(int context, int aChargeOccurrence) throws JSONException, Exception { return ((CrimeOccurrence) registry.getValue(context)).addChargeOccurrence( (ChargeOccurrence) registry.getValue(aChargeOccurrence)).getAttributes(); } public int addSuspectToCrimeOccurrence(int context, String aName, String aPhone, String aSex, String aAddress, String aAge, String aStatement) throws Exception { return registry.getKey(((CrimeOccurrence) registry.getValue(context)) .addSuspect(aName, aPhone, aSex, aAddress, aAge, aStatement)); } public JSONObject addSuspectToCrimeOccurrenceJSON(int context, String aName, String aPhone, String aSex, String aAddress, String aAge, String aStatement) throws JSONException, Exception { return ((CrimeOccurrence) registry.getValue(context)).addSuspect(aName, aPhone, aSex, aAddress, aAge, aStatement).getAttributes(); } public int addSuspectToCrimeOccurrenceOnly(int context, int aSuspect) throws Exception { return registry.getKey(((CrimeOccurrence) registry.getValue(context)) .addSuspect((Suspect) registry.getValue(aSuspect))); } public JSONObject addSuspectToCrimeOccurrenceOnlyJSON(int context, int aSuspect) throws JSONException, Exception { return ((CrimeOccurrence) registry.getValue(context)).addSuspect( (Suspect) registry.getValue(aSuspect)).getAttributes(); } public int addWitnessToCrimeOccurrence(int context, String aName, String aPhone, String aSex, String aAddress, String aAge, String aStatement) throws Exception { return registry.getKey(((CrimeOccurrence) registry.getValue(context)) .addWitness(aName, aPhone, aSex, aAddress, aAge, aStatement)); } public JSONObject addWitnessToCrimeOccurrenceJSON(int context, String aName, String aPhone, String aSex, String aAddress, String aAge, String aStatement) throws JSONException, Exception { return ((CrimeOccurrence) registry.getValue(context)).addWitness(aName, aPhone, aSex, aAddress, aAge, aStatement).getAttributes(); } public int addWitnessToCrimeOccurrenceOnly(int context, int aWitness) throws Exception { return registry.getKey(((CrimeOccurrence) registry.getValue(context)) .addWitness((Witness) registry.getValue(aWitness))); } public JSONObject addWitnessToCrimeOccurrenceOnlyJSON(int context, int aWitness) throws JSONException, Exception { return ((CrimeOccurrence) registry.getValue(context)).addWitness( (Witness) registry.getValue(aWitness)).getAttributes(); } public int addVictimToCrimeOccurrence(int context, String aName, String aPhone, String aSex, String aAddress, String aAge, String aInjurySuffered) throws Exception { return registry.getKey(((CrimeOccurrence) registry.getValue(context)) .addVictim(aName, aPhone, aSex, aAddress, aAge, aInjurySuffered)); } public JSONObject addVictimToCrimeOccurrenceJSON(int context, String aName, String aPhone, String aSex, String aAddress, String aAge, String aInjurySuffered) throws JSONException, Exception { return ((CrimeOccurrence) registry.getValue(context)).addVictim(aName, aPhone, aSex, aAddress, aAge, aInjurySuffered).getAttributes(); } public int addVictimToCrimeOccurrenceOnly(int context, int aVictim) throws Exception { return registry.getKey(((CrimeOccurrence) registry.getValue(context)) .addVictim((Victim) registry.getValue(aVictim))); } public JSONObject addVictimToCrimeOccurrenceOnlyJSON(int context, int aVictim) throws JSONException, Exception { return ((CrimeOccurrence) registry.getValue(context)).addVictim( (Victim) registry.getValue(aVictim)).getAttributes(); } public int addInvestigatingOfficerToCrimeOccurrence(int context, String aName, String aPhone, String aSex, String aAddress, String aAge, int aJurisdiction) throws Exception { return registry.getKey(((CrimeOccurrence) registry.getValue(context)) .addInvestigatingOfficer(aName, aPhone, aSex, aAddress, aAge, (Jurisdiction) registry.getValue(aJurisdiction))); } public JSONObject addInvestigatingOfficerToCrimeOccurrenceJSON(int context, String aName, String aPhone, String aSex, String aAddress, String aAge, int aJurisdiction) throws JSONException, Exception { return ((CrimeOccurrence) registry.getValue(context)) .addInvestigatingOfficer(aName, aPhone, aSex, aAddress, aAge, (Jurisdiction) registry.getValue(aJurisdiction)).getAttributes(); } public int addInvestigatingOfficerToCrimeOccurrenceOnly(int context, int aInvestigatingOfficer) throws Exception { return registry.getKey(((CrimeOccurrence) registry.getValue(context)) .addInvestigatingOfficer((InvestigatingOfficer) registry .getValue(aInvestigatingOfficer))); } public JSONObject addInvestigatingOfficerToCrimeOccurrenceOnlyJSON( int context, int aInvestigatingOfficer) throws JSONException, Exception { return ((CrimeOccurrence) registry.getValue(context)) .addInvestigatingOfficer( (InvestigatingOfficer) registry.getValue(aInvestigatingOfficer)) .getAttributes(); } public int addJurisdictionToCrimeOccurrence(int context, String aName, String aPhone, String aAddress) throws Exception { return registry.getKey(((CrimeOccurrence) registry.getValue(context)) .addJurisdiction(aName, aPhone, aAddress)); } public JSONObject addJurisdictionToCrimeOccurrenceJSON(int context, String aName, String aPhone, String aAddress) throws JSONException, Exception { return ((CrimeOccurrence) registry.getValue(context)).addJurisdiction( aName, aPhone, aAddress).getAttributes(); } public int addJurisdictionToCrimeOccurrenceOnly(int context, int aJurisdiction) throws Exception { return registry.getKey(((CrimeOccurrence) registry.getValue(context)) .addJurisdiction((Jurisdiction) registry.getValue(aJurisdiction))); } public JSONObject addJurisdictionToCrimeOccurrenceOnlyJSON(int context, int aJurisdiction) throws JSONException, Exception { return ((CrimeOccurrence) registry.getValue(context)).addJurisdiction( (Jurisdiction) registry.getValue(aJurisdiction)).getAttributes(); } public void deleteCrimeOccurrence(int context) { ((CrimeOccurrence) registry.getValue(context)).delete(); registry.removeObj(context); } public void deleteChargeOccurrenceFromCrimeOccurrence(int context, int aChargeOccurrence) { ((CrimeOccurrence) registry.getValue(context)) .deleteChargeOccurrence((ChargeOccurrence) registry .getValue(aChargeOccurrence)); } public void deleteSuspectFromCrimeOccurrence(int context, int aSuspect) { ((CrimeOccurrence) registry.getValue(context)) .deleteSuspect((Suspect) registry.getValue(aSuspect)); } public void deleteWitnessFromCrimeOccurrence(int context, int aWitness) { ((CrimeOccurrence) registry.getValue(context)) .deleteWitness((Witness) registry.getValue(aWitness)); } public void deleteVictimFromCrimeOccurrence(int context, int aVictim) { ((CrimeOccurrence) registry.getValue(context)) .deleteVictim((Victim) registry.getValue(aVictim)); } public void deleteInvestigatingOfficerFromCrimeOccurrence(int context, int aInvestigatingOfficer) { ((CrimeOccurrence) registry.getValue(context)) .deleteInvestigatingOfficer((InvestigatingOfficer) registry .getValue(aInvestigatingOfficer)); } public void deleteJurisdictionFromCrimeOccurrence(int context, int aJurisdiction) { ((CrimeOccurrence) registry.getValue(context)) .deleteJurisdiction((Jurisdiction) registry.getValue(aJurisdiction)); } public JSONObject getAttributesOfCrimeOccurrence(int context) throws JSONException { return ((CrimeOccurrence) registry.getValue(context)).getAttributes(); } public int constructJurisdiction(String aName, String aPhone, String aAddress) { return registry.add(new Jurisdiction(aName, aPhone, aAddress)); } public JSONObject constructJurisdictionJSON(String aName, String aPhone, String aAddress) throws JSONException { Jurisdiction contextObj = new Jurisdiction(aName, aPhone, aAddress); registry.add(contextObj); return contextObj.getAttributes(); } public boolean setNameInJurisdiction(int context, String aName) { return ((Jurisdiction) registry.getValue(context)).setName(aName); } public boolean setPhoneInJurisdiction(int context, String aPhone) { return ((Jurisdiction) registry.getValue(context)).setPhone(aPhone); } public boolean setAddressInJurisdiction(int context, String aAddress) { return ((Jurisdiction) registry.getValue(context)).setAddress(aAddress); } public String getNameFromJurisdiction(int context) { return ((Jurisdiction) registry.getValue(context)).getName(); } public String getPhoneFromJurisdiction(int context) { return ((Jurisdiction) registry.getValue(context)).getPhone(); } public String getAddressFromJurisdiction(int context) { return ((Jurisdiction) registry.getValue(context)).getAddress(); } /************ * Method returns an iterator to the list of id's of the elements involved in this list. ***************/ public Iterator getCrimeOccurrencesFromJurisdiction(int context) { ArrayList listOfIDs = new ArrayList(); for (CrimeOccurrence obj : ((Jurisdiction) registry.getValue(context)) .getCrimeOccurrences()) { listOfIDs.add(registry.getKey(obj)); } return listOfIDs.iterator(); } /************ * Method returns an iterator to the list of id's of the elements involved in this list. ***************/ public Iterator getInvestigatingOfficersFromJurisdiction(int context) { ArrayList listOfIDs = new ArrayList(); for (InvestigatingOfficer obj : ((Jurisdiction) registry.getValue(context)) .getInvestigatingOfficers()) { listOfIDs.add(registry.getKey(obj)); } return listOfIDs.iterator(); } public int addCrimeOccurrenceToJurisdiction(int context, String aLocation, String aDate, String aTime, String aDescription) throws Exception { return registry.getKey(((Jurisdiction) registry.getValue(context)) .addCrimeOccurrence(aLocation, aDate, aTime, aDescription)); } public JSONObject addCrimeOccurrenceToJurisdictionJSON(int context, String aLocation, String aDate, String aTime, String aDescription) throws JSONException, Exception { return ((Jurisdiction) registry.getValue(context)).addCrimeOccurrence( aLocation, aDate, aTime, aDescription).getAttributes(); } public int addCrimeOccurrenceToJurisdictionOnly(int context, int aCrimeOccurrence) throws Exception { return registry .getKey(((Jurisdiction) registry.getValue(context)) .addCrimeOccurrence((CrimeOccurrence) registry .getValue(aCrimeOccurrence))); } public JSONObject addCrimeOccurrenceToJurisdictionOnlyJSON(int context, int aCrimeOccurrence) throws JSONException, Exception { return ((Jurisdiction) registry.getValue(context)).addCrimeOccurrence( (CrimeOccurrence) registry.getValue(aCrimeOccurrence)).getAttributes(); } public int addInvestigatingOfficerToJurisdiction(int context, String aName, String aPhone, String aSex, String aAddress, String aAge) throws Exception { return registry.getKey(((Jurisdiction) registry.getValue(context)) .addInvestigatingOfficer(aName, aPhone, aSex, aAddress, aAge)); } public JSONObject addInvestigatingOfficerToJurisdictionJSON(int context, String aName, String aPhone, String aSex, String aAddress, String aAge) throws JSONException, Exception { return ((Jurisdiction) registry.getValue(context)).addInvestigatingOfficer( aName, aPhone, aSex, aAddress, aAge).getAttributes(); } public int addInvestigatingOfficerToJurisdictionOnly(int context, int aInvestigatingOfficer) throws Exception { return registry.getKey(((Jurisdiction) registry.getValue(context)) .addInvestigatingOfficer((InvestigatingOfficer) registry .getValue(aInvestigatingOfficer))); } public JSONObject addInvestigatingOfficerToJurisdictionOnlyJSON(int context, int aInvestigatingOfficer) throws JSONException, Exception { return ((Jurisdiction) registry.getValue(context)).addInvestigatingOfficer( (InvestigatingOfficer) registry.getValue(aInvestigatingOfficer)) .getAttributes(); } public void deleteJurisdiction(int context) { ((Jurisdiction) registry.getValue(context)).delete(); registry.removeObj(context); } public void deleteCrimeOccurrenceFromJurisdiction(int context, int aCrimeOccurrence) { ((Jurisdiction) registry.getValue(context)) .deleteCrimeOccurrence((CrimeOccurrence) registry .getValue(aCrimeOccurrence)); } public void deleteInvestigatingOfficerFromJurisdiction(int context, int aInvestigatingOfficer) { ((Jurisdiction) registry.getValue(context)) .deleteInvestigatingOfficer((InvestigatingOfficer) registry .getValue(aInvestigatingOfficer)); } public JSONObject getAttributesOfJurisdiction(int context) throws JSONException { return ((Jurisdiction) registry.getValue(context)).getAttributes(); } }