A Queue
implemented using a backing Array
where
the front of the queue is the smallest element according
to the order relation defined by compare()
function.
Note that this implementation doesn't guarantee the back/last
element to be the largest element of the queue.
The size of the backing Array
is called the capacity
of the PriorityQueue
. The capacity of a new instance is
specified by the given initialCapacity
. The capacity is
increased when size
exceeds the capacity. The new
capacity is the product of the needed capacity and the
given growthFactor
.
no subtypes hierarchy
Initializer |
PriorityQueue(Comparison compare(Element x, Element y), Integer initialCapacity = 0, Float growthFactor = ..., {Element*} elements = ...) |
Attributes | |
back | Source Codeshared actual Element? back The element currently at the end of the
queue, or Refines Queue.back |
front | Source Codeshared actual Element? front The smallest element (regarding the order
relation defined by Refines Queue.front |
last | Source Codeshared actual Element? last The element currently at the end of the
queue, or Refines Iterable.last |
size | Source Codeshared actual Integer size The number of elements returned by the Refines Iterable.size |
Inherited Attributes |
Attributes inherited from: Object |
Attributes inherited from: Collection<Element> |
Attributes inherited from: Iterable<Element,Absent> |
Attributes inherited from: Queue<Element> |
Methods | |
accept | Source Codeshared actual Element? accept() Remove and return the smallest element
( Refines Queue.accept |
clone | Source Codeshared actual PriorityQueue<Element> clone() A shallow copy of this collection, that is, a collection with identical elements which does not change if this collection changes. If this collection is immutable, it is acceptable to return a reference to this collection. If this collection is mutable, a newly instantiated collection must be returned. Refines Collection.clone |
iterator | Source Codeshared actual Iterator<Element> iterator() An iterator for the elements belonging to this queue. Elements returned by this iterator are not ordered Refines Iterable.iterator |
offer | Source Codeshared actual void offer(Element element) Add a new element to the queue. Refines Queue.offer |
Inherited Methods |
Methods inherited from: Object |
Methods inherited from: Category<Element> |
Methods inherited from: Collection<Element> |
Methods inherited from: Iterable<Element,Absent> any() , by() , chain() , collect() , contains() , count() , defaultNullElements() , each() , every() , filter() , find() , findLast() , flatMap() , fold() , follow() , frequencies() , getFromFirst() , group() , indexes() , interpose() , iterator() , locate() , locateLast() , locations() , longerThan() , map() , max() , narrow() , partition() , product() , reduce() , repeat() , scan() , select() , sequence() , shorterThan() , skip() , skipWhile() , sort() , spread() , summarize() , tabulate() , take() , takeWhile() |
Methods inherited from: Queue<Element> |