INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES

indexing

title: "Stacks: dispensers implementing a last-in, first-out policy"
project: "Visual Eiffel"
revision: "$Revision: 1.2 $"
copyright: "Copyright (C) 1996-2005 Object Tools Group"
license: "http://visual-eiffel.com/license"
cluster: containers
class STACK_ [G]
inherit

DISPENSER_ [G]
end
feature -- Operations

put (x: G)
-- add the new entry into the dispenser which immediately after
-- becomes the "active entry" of the dispenser
require
valid_item: x /= void

remove
-- deletes the "active entry" and sets 'item' to the one most
-- recently put into if at least one entry exists after the
-- removal - if it does not then 'item' is set to Void or,
-- to be exact, to the default value of the type ...
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 STACK_

INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES