note description: "Stacks with a bounded physical size, implemented by arrays" library: "Free implementation of ELKS library" legal: "See notice at end of class." status: "See notice at end of class." names: dispenser, array representation: array access: fixed, lifo, membership size: fixed contents: generic date: "$Date: 2018-11-13 12:58:34 +0000 (Tue, 13 Nov 2018) $" revision: "$Revision: 102449 $" class BOUNDED_STACK [G] inherit ARRAYED_STACK [G] redefine extendible, correct_mismatch end BOUNDED [G] undefine copy, is_equal end create make, make_from_iterable feature -- Status report extendible: BOOLEAN -- May new items be added? (Answer: yes.) do Result := not full ensure then Result = not full end feature -- Correction correct_mismatch -- Attempt to correct object mismatch using Mismatch_information. local i: INTEGER_32 do if attached {ARRAY [G]} Mismatch_information.item ("fl") as array_content and then attached {INTEGER_32} Mismatch_information.item ("count") as l_count and then attached {BOOLEAN} Mismatch_information.item ("object_comparison") as l_comp and then attached {INTEGER_32} Mismatch_information.item ("index") as l_index then create area_v2.make_empty (array_content.count - 1) from i := 1 until i > l_count loop extend (array_content.area.item (i)) i := i + 1 end object_comparison := l_comp index := l_index else Precursor end end invariant count_small_enough: count <= capacity note copyright: "Copyright (c) 1984-2018, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software 5949 Hollister Ave., Goleta, CA 93117 USA Telephone 805-685-1006, Fax 805-685-6869 Website http://www.eiffel.com Customer support http://support.eiffel.com ]" end -- class BOUNDED_STACK
Generated by ISE EiffelStudio