|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--DisplayPanel | +--HospitalView
Hospital simulation.
Field Summary | |
protected Action[] |
assignPriority
Send the current patient to the waiting room with a given priority. |
protected Patient[] |
beds
Hospital beds in this. |
protected PatientView[] |
bedViews
Views for patients in beds. |
protected DisplayPanel |
controlPanel
View for control panel. |
protected int |
emptyBed
Index of next empty bed in this. |
protected int |
nextPatientCount
Time until next new patient. |
protected Vector |
nextPatients
Patients needing services. |
protected PatientView |
nextPatientView
View for new patient needing services. |
protected static String[] |
PRIORITIES
Priority descriptors. |
protected int |
time
Time for this. |
protected JLabel |
timeView
Clock for this. |
protected IPriorityQueue |
triage
Waiting room manager for this. |
protected Vector |
waiting
List of patients in waiting room. |
protected TablePanel |
waitingContainer
Views for patients waiting for beds. |
Constructor Summary | |
HospitalView(int aCount)
Constructs a new emergency room with the given number of beds. |
Method Summary | |
protected boolean |
aBedIsFree()
Returns whether or not there is a free bed. |
protected void |
admit(Patient aPatient)
Admits the given patient to a bed. |
protected void |
admitHighest()
Admits the highest priority waiting patient. |
protected void |
assignPriority(int priority)
Sends the new patient to the waiting room with the given priority. |
protected void |
click()
Ticks the clock ahead one minute. |
protected void |
createNextPatientIfNecessary()
Creates a new patient if it is time to do so. |
protected int |
nextPatientTime()
Returns the number of minutes before the next patient will arrive. |
protected void |
showNextPatient()
Shows the next patient to admit or make wait. |
protected String |
timeString()
Returns the text of the time of this. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final String[] PRIORITIES
protected IPriorityQueue triage
protected Vector waiting
protected Patient[] beds
protected int emptyBed
protected int time
protected int nextPatientCount
protected Vector nextPatients
protected PatientView nextPatientView
protected JLabel timeView
protected PatientView[] bedViews
protected TablePanel waitingContainer
protected DisplayPanel controlPanel
protected Action[] assignPriority
Constructor Detail |
public HospitalView(int aCount)
aCount
- number of bedsMethod Detail |
protected void click()
protected String timeString()
protected void admit(Patient aPatient)
protected void assignPriority(int priority)
protected boolean aBedIsFree()
protected void admitHighest()
protected int nextPatientTime()
protected void createNextPatientIfNecessary()
protected void showNextPatient()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |