INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES

indexing

title: "Key priority queues: dispensers with two element entries", "in which only the entry with the largest key 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 KEY_PRIORITY_QUEUE_ [G, H -> COMPARABLE]
inherit

KEYED_DISPENSER_ [G, H]
redefine
pool
end
feature -- Operations

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

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

table_of_elements: TABLE_ [G, H]
-- 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 KEY_PRIORITY_QUEUE_

INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES