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 Collection<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> Iterable.any() , Iterable.by() , Iterable.chain() , Iterable.collect() , Iterable.count() , Iterable.defaultNullElements() , Iterable.every() , Iterable.filter() , Iterable.find() , Iterable.findLast() , Iterable.flatMap() , Iterable.fold() , Iterable.follow() , Iterable.getFromFirst() , Iterable.interpose() , Iterable.iterator() , Iterable.longerThan() , Iterable.map() , Iterable.max() , Iterable.partition() , Iterable.product() , Iterable.reduce() , Iterable.repeat() , Iterable.scan() , Iterable.select() , Iterable.sequence() , Iterable.shorterThan() , Iterable.skip() , Iterable.skipWhile() , Iterable.sort() , Iterable.spread() , Iterable.take() , Iterable.takeWhile() |
Methods inherited from: Queue<Element> |