FileDocCategorySizeDatePackage
InPatient.javaAPI DocExample844Tue Feb 12 13:34:00 GMT 2002hospital

InPatient.java

package hospital;

/**
 * Title:        Nick Bowring
 * Description:
 * Copyright:    Copyright (c) 2001
 * Company:
 * @author
 * @version 1.0
 */

public class InPatient {
  private Ward ward;
  private int nrDaysResident;
  public InPatient() {
  }
  public int displayDetails(Graphics g, int x, int y) {
    int newY = super.displayDetails(g, x, y);
    // newY is the next place to start drawing on the JPanel
    g.drawText("Number of days resident = "+nrDaysResident,x,newY);
    ward.displayDetails(g, x, newY+20);
    return newY+40;
  }

  public void setDetails(String name, String ID, int age, char sex,
                         Consultant consultant,
                         int nrDaysResident, Ward ward) {
    super.setDetails(name,ID,age,sex,consultant);
    this.nrDaysResident = nrDaysResident;
    this.ward = ward;
  }



}