Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Chart Relations Text Flat Contracts Flat contracts Go to:
indexing description: "Objects that are able to iterate over linear structures" status: "See notice at end of class" names: iterators, iteration, linear_iterators, linear_iteration date: "$Date: 2001-11-16 20:32:23 +0000 (Fri, 16 Nov 2001) $" revision: "$Revision: 51435 $" class interface LINEAR_ITERATOR [G] create set feature -- Initialization set (s: like target) -- Make s the new target of iterations. feature -- Access item: G -- The item at cursor position in target require traversable_exists: target /= void item_tuple: TUPLE [G] -- Tuple containing a single element, -- the item at cursor position in target'' target: LINEAR [G] -- The structure to which iteration features will apply. feature -- Cursor movement start -- Move to first position of target. forth -- Move to next position of target. off: BOOLEAN -- Is position of target off? exhausted: BOOLEAN -- Is target exhausted? feature -- Iteration do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) -- Apply action to every item of target up to -- and including first one not satisfying test. -- (from the start of target) ensure then finished: not exhausted implies not test.item (item_tuple) continue_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) -- Apply action to every item of target up to -- and including first one not satisfying test -- (from the current position of target). require else invariant_satisfied: invariant_value ensure then finished: not exhausted implies not test.item (item_tuple) while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) -- Apply action to every item of target up to -- but excluding first one not satisfying test. -- (Apply to full list if all items satisfy test.) ensure then finished: not exhausted implies not test.item (item_tuple) while_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) -- Apply action to every item of target up to -- but excluding first one not satisfying test. ensure finished: not exhausted implies not test.item (item_tuple) until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) -- Apply action to every item of target up to -- but excluding first one satisfying test. -- (Apply to full list if no item satisfies test.) ensure then achieved: not exhausted implies test.item (item_tuple) until_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) -- Apply action to every item of target from current -- position, up to but excluding first one satisfying test. require invariant_satisfied: invariant_value ensure achieved: exhausted or else test.item (item_tuple) invariant_satisfied: invariant_value do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) -- Apply action to every item of target up to -- and including first one satisfying test. ensure then achieved: not exhausted implies test.item (item_tuple) continue_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) -- Apply action to every item of target up to -- and including first one satisfying test. -- (from the current position of target). require invariant_satisfied: invariant_value ensure then achieved: not exhausted implies test.item (item_tuple) search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN) -- Search the first item of target for which test -- has the same value as b (both true or both false). continue_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN) -- Search the first item of target -- satisfying: test equals to b -- (from the current position of target). ensure then found: not exhausted = (b = test.item (item_tuple)) do_for (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER) -- Apply action to every k-th item, -- n times if possible, starting from i-th. require valid_start: i >= 1 valid_repetition: n >= 0 valid_skip: k >= 1 continue_for (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER) -- Apply action to every k-th item, -- n times if possible. require valid_repetition: n >= 0 valid_skip: k >= 1 for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN -- Does test return true for -- all items of target? there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN -- Does test return true for -- at least one item of target? feature -- Implementation internal_item_tuple: TUPLE [G] -- Field holding the last item of target invariant target_exists: target /= void item_tuple_exists: item_tuple /= void internal_item_tuple_exists: internal_item_tuple /= void end -- class LINEAR_ITERATOR
Classes Clusters Cluster hierarchy Chart Relations Text Flat Contracts Flat contracts Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com