evacuation
Class EvacueeQueue

java.lang.Object
  extended by evacuation.EvacueeQueue

public class EvacueeQueue
extends java.lang.Object

This class represents a waiting list for people fleeing a sinking ship.

Author:
Ben Douglass

Constructor Summary
EvacueeQueue()
          Constructs an empty EvacueeQueue.
 
Method Summary
 void add(Evacuee e)
          Adds a person to the waiting list to get off the ship.
 Evacuee getNextEvacuee()
          Returns the person in the waiting list with highest priority to get off the ship, and removes them from the list.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EvacueeQueue

public EvacueeQueue()
Constructs an empty EvacueeQueue.

Method Detail

add

public void add(Evacuee e)
Adds a person to the waiting list to get off the ship.

Parameters:
e - The person to add to the list

getNextEvacuee

public Evacuee getNextEvacuee()
Returns the person in the waiting list with highest priority to get off the ship, and removes them from the list. If the waiting list is empty, returns null.

Returns:
The evacuee of highest priority