src/main/java/org/jboss/util/timeout/HashedTimeoutPriorityQueueImpl.java
/**
       * Remove a node from the tree and normalize.
       *
       * @param index the index in the queue
       * @return the removed node.
       */
Remove a node from the tree and normalize.
@param index the index in the queue
@return the removed node.
Remove a node from the tree and normalize . @param index the index in the queue @return the removed node .
private TimeoutExtImpl removeNode(int index)
      {
         TimeoutExtImpl res = queue[index];
         if (index == size)
         {
            --size;
            queue[index] = null;
            return res;
         }
         swap(index, size); 
         --size;
         queue[res.index] = null;
         if (normalizeUp(index))
            return res; 
         normalizeDown(index);
         return res;
      }
private TimeoutExtImpl removeNode ( int index ) { TimeoutExtImpl res = queue [ index ] ; if ( index == size ) { -- size ; queue [ index ] = null ; return res ; } swap ( index , size ) ; -- size ; queue [ res . index ] = null ; if ( normalizeUp ( index ) ) return res ; normalizeDown ( index ) ; return res ; }
Remove a node from the tree and normalize.
Remove a node from the tree and normalize .
// INV: assertExpr(index > 0); // INV: assertExpr(index <= size); // INV: assertExpr(res != null); // INV: assertExpr(res.index == index); // Exchange removed node with last leaf node // INV: assertExpr(res.index == size + 1); // Node moved up, so it shouldn't move down