uchicago.src.sim.engine
Class ActionQueue

java.lang.Object
  extended by uchicago.src.sim.engine.ActionQueue

public class ActionQueue
extends java.lang.Object

Priority Queue for Action objects.


Constructor Summary
ActionQueue()
           
ActionQueue(int size)
           
 
Method Summary
 void clear()
           
 void fixHeap()
           
 void insert(BasicAction action)
          Insert the specified action into the heap.
 boolean isEmpty()
           
 BasicAction peekMin()
           
 BasicAction popMin()
           
 int size()
           
 void toss(BasicAction action)
           
 java.lang.String toString()
           
 boolean voidAction(BasicAction action)
          Find the specified Action in the queue and void it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ActionQueue

public ActionQueue()

ActionQueue

public ActionQueue(int size)
Method Detail

voidAction

public boolean voidAction(BasicAction action)
Find the specified Action in the queue and void it. Voiding means replace that action with an empty action that does nothing.

Returns:
returns true if the action is found and voided, false if this ActionQueue does not contain the specified BasicAction.

insert

public void insert(BasicAction action)
Insert the specified action into the heap. If heap order is being maintained, that is, it is not already invalidated, percolate action up as needed.


peekMin

public BasicAction peekMin()

popMin

public BasicAction popMin()

toss

public void toss(BasicAction action)

clear

public void clear()

fixHeap

public void fixHeap()

isEmpty

public boolean isEmpty()

size

public int size()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object