Class DisiPriorityQueue

  • All Implemented Interfaces:
    java.lang.Iterable<DisiWrapper>

    public final class DisiPriorityQueue
    extends java.lang.Object
    implements java.lang.Iterable<DisiWrapper>
    A priority queue of DocIdSetIterators that orders by current doc ID. This specialization is needed over PriorityQueue because the pluggable comparison function makes the rebalancing quite slow.
    • Field Detail

      • size

        private int size
    • Constructor Detail

      • DisiPriorityQueue

        public DisiPriorityQueue​(int maxSize)
    • Method Detail

      • leftNode

        static int leftNode​(int node)
      • rightNode

        static int rightNode​(int leftNode)
      • parentNode

        static int parentNode​(int node)
      • size

        public int size()
      • top2

        public DisiWrapper top2()
        Return the 2nd least value in this heap, or null if the heap contains less than 2 values.
      • topList

        public DisiWrapper topList()
        Get the list of scorers which are on the current doc.
      • addAll

        public void addAll​(DisiWrapper[] entries,
                           int offset,
                           int len)
      • clear

        public void clear()
        Clear the heap.
      • upHeap

        void upHeap​(int i)
      • downHeap

        void downHeap​(int size)
      • iterator

        public java.util.Iterator<DisiWrapper> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<DisiWrapper>