INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES

indexing

title: "Priority queues: dispensers with one element entries", "in which only the largest element is accessed"
project: "Visual Eiffel"
revision: "$Revision: 1.2 $"
copyright: "Copyright (C) 1996-2005 Object Tools Group"
license: "http://visual-eiffel.com/license"
cluster: containers
class PRIORITY_QUEUE_ [G -> COMPARABLE]
inherit

DISPENSER_ [G]
redefine
pool
end
feature -- Operations

put (x: G)
-- adds the new entry into the dispenser
require
valid_item: x /= void

remove
-- deletes the "active entry" and sets 'item' to the largest one
-- among those still existing in the dispenser after the removal
-- if there are no more entries then 'item' is set to Void
ensure
well_done: cs.is_finished
feature -- Queries

list_of_elements: LIST_ [G]
-- delivers all the entries of the dispenser in the order in
-- which they would be repeatedly removed if it really happened
ensure
well_done: cs /= void implies cs.is_finished
end -- class PRIORITY_QUEUE_

INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES