Class BucketQueue<T>


  • @ParametersAreNonnullByDefault
    public class BucketQueue<T>
    extends java.lang.Object
    Priority queue based on circular buffer of fixed size. Effective for the case when keys are within relatively low fixed range: maxKey - minKey < bucketCount.
    • Constructor Summary

      Constructors 
      Constructor Description
      BucketQueue​(int bucketCount, boolean ascending)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isEmpty()  
      void offer​(T obj, long key)  
      T poll()  
      boolean remove​(T obj)  
      • Methods inherited from class java.lang.Object

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

      • BucketQueue

        public BucketQueue​(int bucketCount,
                           boolean ascending)
    • Method Detail

      • offer

        public void offer​(T obj,
                          long key)
      • poll

        @Nullable
        public T poll()
      • isEmpty

        public boolean isEmpty()
      • remove

        public boolean remove​(T obj)