This site contains older material on Eiffel. For the main Eiffel page, see http://www.eiffel.com.

EiffelBase class
(HTML page generated by ISE Eiffel 4.2)

Eiffel Class
indexing
	description: "Priority queues implemented as sorted lists";
	status: "See notice at end of class";
	names: priority_queue, queue;
	contents: generic;
	date: "$Date: 2007-03-30 11:10:11 -0800 (Fri, 30 Mar 2007) $";
	revision: "$Revision: 95354 $"

class LINKED_PRIORITY_QUEUE [G -> COMPARABLE]

inherit
	PRIORITY_QUEUE [G]
		undefine
			consistent, copy, is_equal, setup, prune_all, append, readable, writable
		select
			put, remove, item
		end;
	SORTED_TWO_WAY_LIST [G]
		rename
			make as sl_make,
			remove as sl_remove,
			put as sl_put,
			item as sl_item
		export
			{NONE} all
		end

creation
	make

feature -- Initialization

	make is
			-- Allocate heap space.
		do
			sl_make
		end;

feature -- Access

	item: G is
			-- Entry at top of heap.
		do
			Result := i_th (count)
		end;

feature -- Removal

	remove is
			-- Remove item of highest value.
		do
			go_i_th (count);
			sl_remove;
			go_i_th (count)
		end;

feature -- Element change

	put (v: like item) is
			-- Insert item v at its proper position.
		do
			extend (v)
		end;

end -- class LINKED_PRIORITY_QUEUE