All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.micronova.util.IXPQueue

java.lang.Object
   |
   +----com.micronova.util.IXVector
           |
           +----com.micronova.util.IXPQueue

public abstract class IXPQueue
extends IXVector
IXPQueue is element-type-independent priority queue implemented as an IXVector. Elements are stored at indexes 1, 2, ..., and 0-th position is used as push/pull gateway. MAKE SURE THE LENGTH IS GREATER THAN 0.

Version:
1.0

Constructor Index

 o IXPQueue()

Method Index

 o _compare(int, int)
Returns true if element at index 'i' is 'smaller' than that at index 'j'.
 o _down(int)
Moves down element at i to the right position in the queue.
 o _pull0(int)
Pulls the i-th element out to index 0.
 o _push0()
Pushes the element at index 0.
 o _swap(int, int)
Swaps i-th element with j-th.
 o _up(int)
Moves up element at i to the right position in the queue.

Constructors

 o IXPQueue
 public IXPQueue()

Methods

 o _compare
 protected abstract boolean _compare(int i,
                                     int j)
Returns true if element at index 'i' is 'smaller' than that at index 'j'. The 'smallest' element is always found at index 1.

 o _swap
 protected abstract void _swap(int i,
                               int j)
Swaps i-th element with j-th.

 o _up
 protected final void _up(int i)
Moves up element at i to the right position in the queue.

 o _down
 protected final void _down(int i)
Moves down element at i to the right position in the queue.

 o _push0
 protected final void _push0()
Pushes the element at index 0.

 o _pull0
 protected final void _pull0(int i)
Pulls the i-th element out to index 0. The index must be greater than 0. It is assumed that 0-th element is already 'unset'.


All Packages  Class Hierarchy  This Package  Previous  Next  Index