Package emergencyroom

Source Code of emergencyroom.ERModel

/*
* ERModel.java
*
* Created on February 12, 2007, 8:47 AM
*
*/

package emergencyroom;

import java.util.PriorityQueue;

/**
*
* @author Kyle Johnson
*/
public class ERModel
{
    PriorityQueue pqueue;
   
    /** Creates a new instance of ERModel */
    public ERModel()
    {
  pqueue = new PriorityQueue();
    }
   
    public void schedule(Patient p)
    {
  pqueue.add(p);
    }
   
    public Patient treatNext()
    {
  return (Patient)pqueue.poll();
    }
   
   
}
TOP

Related Classes of emergencyroom.ERModel

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.