Author(s)Peter Donald, Ram Chidambaram, Michael A. Smith, Paul Jack, Stephen Colebourne, Steve Phelps
Binary heap implementation of Buffer that provides for
removal based on Comparator ordering.
The removal order of a binary heap is based on either the natural sort
order of its elements or a specified Comparator . The
remove() method always returns the first element as determined
by the sort order. (The ascendingOrder flag in the constructors
can be used to reverse the sort order, in which case remove()
will always remove the last element.) The removal order is
not the same as the order of iteration; elements are
returned by the iterator in no particular order.
The add(Object) and remove() operations perform
in logarithmic time. The get() operation performs in constant
time. All other operations perform in linear time or worse.
Bufferthat provides for removal based onComparatorordering.The removal order of a binary heap is based on either the natural sort order of its elements or a specified Comparator . The remove() method always returns the first element as determined by the sort order. (The
ascendingOrderflag in the constructors can be used to reverse the sort order, in which case remove() will always remove the last element.) The removal order is not the same as the order of iteration; elements are returned by the iterator in no particular order.The add(Object) and remove() operations perform in logarithmic time. The get() operation performs in constant time. All other operations perform in linear time or worse.
Note that this implementation is not synchronized. Use synchronizedBuffer(Buffer) or decorate(Buffer) to provide synchronized access to a
PriorityBuffer:This class is Serializable from Commons Collections 3.2.