note description: "External forward one-step iteration cursor for {ARRAYED_LIST}." library: "EiffelBase: Library of reusable components for Eiffel." date: "$Date: 2016-04-13 13:29:38 +0000 (Wed, 13 Apr 2016) $" revision: "$Revision: 98619 $" class ARRAYED_LIST_ITERATION_CURSOR [G] inherit GENERAL_SPECIAL_ITERATION_CURSOR [G, ARRAYED_LIST [G]] redefine is_valid end create {ARRAYED_LIST, ARRAYED_LIST_ITERATION_CURSOR} make feature {NONE} -- Creation make (t: like target) -- Initialize cursor for target t. require t_attached: attached t do target := t area := target.area area_last_index := t.upper - First_index ensure target_set: target = t is_valid: is_valid default_step: Step = 1 ascending_traversal: not Is_reversed first_index_set: First_index = t.Lower last_index_set: last_index = t.upper end feature -- Access First_index: INTEGER_32 = 1 -- First valid index of target structure for current iteration. -- Note that if Is_reversed, First_index might be greater than last_index. new_cursor: ARRAYED_LIST_ITERATION_CURSOR [G] -- Restarted cursor of the iteration. do create Result.make (target) end feature -- Status report is_valid: BOOLEAN -- Is the cursor still compatible with the associated underlying object? do Result := target.area = area and then Precursor end feature {TYPED_INDEXABLE_ITERATION_CURSOR}{TYPED_INDEXABLE_ITERATION_CURSOR} -- Access target: ARRAYED_LIST [G] -- Associated structure used for iteration. feature {NONE} -- Access Area_first_index: INTEGER_32 = 0 -- First valid index of area. note copyright: "Copyright (c) 1984-2016, 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 ARRAYED_LIST_ITERATION_CURSOR
Generated by ISE EiffelStudio