Class HashedTimeoutPriorityQueueImpl.InternalPriorityQueue

  • Enclosing class:
    HashedTimeoutPriorityQueueImpl

    private class HashedTimeoutPriorityQueueImpl.InternalPriorityQueue
    extends java.lang.Object
    Internal priority queue
    • Constructor Detail

      • InternalPriorityQueue

        InternalPriorityQueue()
        Create a new InternalPriorityQueue.
    • Method Detail

      • compareAndSwapWithTop

        boolean compareAndSwapWithTop​(boolean notify)
      • clear

        public void clear()
      • cancel

        public void cancel()
      • size

        public int size()
      • normalizeUp

        private boolean normalizeUp​(int index)
        A new node has been added at index index. Normalize the tree by moving the new node up the tree.
        Returns:
        true if the tree was modified.
      • normalizeDown

        void normalizeDown​(int index)
      • swap

        private void swap​(int a,
                          int b)
        Swap two nodes in the tree.
        Parameters:
        a - the first index
        b - the second index
      • checkTree

        void checkTree()
        Check invariants of the queue.