FileDocCategorySizeDatePackage
Ward.javaAPI DocExample1546Sun Oct 28 21:05:46 GMT 2001hospital.myprojects

Ward

public class Ward extends Object

Fields Summary
private int
numberBeds
private final int
maxNumberBeds
private String
wardName
private int
numberBedsOccupied
private Patient[]
patient
Constructors Summary
Methods Summary
public java.lang.StringaddPatient(Patient patient)

		if(numberBedsOccupied < numberBeds) {
			this.patient[numberBedsOccupied] = patient;
			numberBedsOccupied++;
			return "Patient successfully added to ward";
		} else {
			return "Ward full";
		}
	
public voiddisplayWardDetails()

		System.out.println("Displaying ward details");
		System.out.println("Ward name: " + wardName);
		System.out.println("Number of beds: " + numberBeds);
		int iloop;
		for(iloop = 0; iloop < numberBedsOccupied; iloop++) {
			System.out.println("Patient's name = " + patient[iloop].getName());
		    System.out.println("Patient's ID = " + patient[iloop].getID());
		    System.out.println("Patients last pulse = " + patient[iloop].getPulse());
		}
		System.out.println("array size is "+patient.length);
	
public voidsetWardDetails(int numberBeds, java.lang.String wardName)

	
	      
		this.numberBeds = numberBeds;
		this.wardName = wardName;