Class MinMaxPriorityQueue.Builder<B>

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Builder​(java.util.Comparator<B> comparator)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T extends B>
      MinMaxPriorityQueue<T>
      create()
      Builds a new min-max priority queue using the previously specified options, and having no initial contents.
      <T extends B>
      MinMaxPriorityQueue<T>
      create​(java.lang.Iterable<? extends T> initialContents)
      Builds a new min-max priority queue using the previously specified options, and having the given initial elements.
      MinMaxPriorityQueue.Builder<B> expectedSize​(int expectedSize)
      Configures this builder to build min-max priority queues with an initial expected size of expectedSize.
      MinMaxPriorityQueue.Builder<B> maximumSize​(int maximumSize)
      Configures this builder to build MinMaxPriorityQueue instances that are limited to maximumSize elements.
      private <T extends B>
      Ordering<T>
      ordering()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • comparator

        private final java.util.Comparator<B> comparator
      • expectedSize

        private int expectedSize
      • maximumSize

        private int maximumSize
    • Constructor Detail

      • Builder

        private Builder​(java.util.Comparator<B> comparator)
    • Method Detail

      • expectedSize

        public MinMaxPriorityQueue.Builder<B> expectedSize​(int expectedSize)
        Configures this builder to build min-max priority queues with an initial expected size of expectedSize.
      • maximumSize

        public MinMaxPriorityQueue.Builder<B> maximumSize​(int maximumSize)
        Configures this builder to build MinMaxPriorityQueue instances that are limited to maximumSize elements. Each time a queue grows beyond this bound, it immediately removes its greatest element (according to its comparator), which might be the element that was just added.
      • create

        public <T extends BMinMaxPriorityQueue<T> create()
        Builds a new min-max priority queue using the previously specified options, and having no initial contents.
      • create

        public <T extends BMinMaxPriorityQueue<T> create​(java.lang.Iterable<? extends T> initialContents)
        Builds a new min-max priority queue using the previously specified options, and having the given initial elements.
      • ordering

        private <T extends BOrdering<T> ordering()