public Hospital mapRow(ResultSet rs, int rowNum) throws SQLException { Hospital hospital = new Hospital(); hospital.setDomainId(rs.getString("HOSPITAL_DOMAIN_ID")); hospital.setDomainName(rs.getString("HOSPITAL_DOMAIN_NAME")); hospital.setPrefix(rs.getString("HOSPITAL_PID_PREFIX")); return hospital; }
public boolean setHospital(Hospital aHospital) { boolean wasSet = false; if (aHospital == null) { return wasSet; } Hospital existingHospital = hospital; hospital = aHospital; if (existingHospital != null && !existingHospital.equals(aHospital)) { existingHospital.removeEmployee(this); } hospital.addEmployee(this); wasSet = true; return wasSet; }
public void delete() { for (int i = shifts.size(); i > 0; i--) { Shift aShift = shifts.get(i - 1); aShift.delete(); } for (int i = privileges.size(); i > 0; i--) { Privilege aPrivilege = privileges.get(i - 1); aPrivilege.delete(); } Hospital placeholderHospital = hospital; this.hospital = null; placeholderHospital.removeEmployee(this); ArrayList<Ward> copyOfWards = new ArrayList<Ward>(wards); wards.clear(); for (Ward aWard : copyOfWards) { aWard.removeEmployee(this); } }
@Override public String toString() { return String.format( "Person[firstName='%s', lastName='%s', dateOfBirth='%s', gender='%s', hospital='%s']", getFirstName(), getLastName(), String.format("%tY-%tm-%td", dateOfBirth, dateOfBirth, dateOfBirth), gender.toString(), hospital.getCode()); }
public static void main(String[] args) { Building b = new Building(); b.area = 1000; b.location = "Hrasnicka 17"; b.population = 1000; University u = new University(); u.area = 500; u.location = "Butmirska 100"; u.population = 1200; u.name = "IUS"; u.isItPublic = false; u.numberOfFaculties = 3; u.numberOfStaff = 200; System.out.println(u.getPopulationDensity()); u.printInformation(); Hospital h = new Hospital(); h.area = 200; h.location = "Vrbanja 12"; h.population = 50; h.hasCTMachine = false; h.isItPublic = false; h.numberOfSurgeons = 20; h.numberOfBeds = 20; System.out.println(h.getPopulationDensity()); Jail j = new Jail(); j.area = 2000; j.location = "Grbavicka 12"; j.population = 1600; j.hasGym = true; j.numberOfCells = 800; j.numberOfFreeCells = 0; j.securityLevel = "Max"; System.out.println(j.getPopulationDensity()); System.out.println(j.getNumberOfOccupiedCells()); }
public static void main(String[] args) { Hospital hospital = new Hospital(); hospital.launch(); }