FileDocCategorySizeDatePackage
Hospital.javaAPI DocExample1254Sun Oct 28 12:02:26 GMT 2001hospital.myprojects

Hospital

public class Hospital extends Frame

Fields Summary
private Patient
p1
private Patient
p2
private Patient
p3
private Ward
w1
Constructors Summary
public Hospital()

	
	  
		addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e) {
				dispose();
				System.exit(0);
			}
		});
		String returnMessage;
		p1.setPatientDetails("June Smith", 66 , "AB1234D");
		p2.setPatientDetails("Fred Bloggs",75 , "wm123456c");
		p3.setPatientDetails("Hilary Hobbs",80, "bb876543d");
		// Set up a ward with 10 beds, named Otter, and add 3 patients
		w1.setWardDetails(10 , "Otter");
		// addPatient method returns a String type message, so print it out...
		returnMessage = w1.addPatient(p1);
		System.out.println(returnMessage);
		returnMessage = w1.addPatient(p2);
		System.out.println(returnMessage);
		returnMessage = w1.addPatient(p3);
		System.out.println(returnMessage);
		
		
		// Display the details of the ward
		w1.displayWardDetails();
	
Methods Summary
public static voidmain(java.lang.String[] args)

		System.out.println("Starting Hospital with Arrays...");
		Hospital mainFrame = new Hospital();