edu.buffalo.fs7.qsymbol2
Class PriorityQueue

java.lang.Object
  |
  +--edu.buffalo.fs7.qsymbol2.PriorityQueue

public class PriorityQueue
extends java.lang.Object

this class represents a data structure to provide the QubitSelectionModel with the capability of tracking the order of how the rows got selected.

The structure works as follows: in principle it is a queue, that is the element first put into it is the first element which gets out. But if an element is added which is already in the queue, it is removed from the higher priority position (earlier in the queue) and added to the end


Field Summary
protected  java.util.Vector elements
           
protected  java.util.Hashtable keys
           
 
Constructor Summary
PriorityQueue()
          create an empty queue
 
Method Summary
 void add(int index)
          add an element
 java.util.Enumeration elements()
          returns the queue in the order of highest priority (earliest selection)
 java.util.Vector getQueue()
           
 boolean remove(int index)
          remove an element
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

keys

protected java.util.Hashtable keys

elements

protected java.util.Vector elements
Constructor Detail

PriorityQueue

public PriorityQueue()
create an empty queue
Method Detail

add

public void add(int index)
add an element

remove

public boolean remove(int index)
remove an element

elements

public java.util.Enumeration elements()
returns the queue in the order of highest priority (earliest selection)

getQueue

public java.util.Vector getQueue()