note
	description: "Concrete version of an external iteration cursor for {READABLE_INDEXABLE}."
	library: "EiffelBase: Library of reusable components for Eiffel."
	status: "See notice at end of class."
	legal: "See notice at end of class."
	date: "$Date: 2017-02-09 12:11:51 +0000 (Thu, 09 Feb 2017) $"
	revision: "$Revision: 99809 $"

class interface
	READABLE_INDEXABLE_ITERATION_CURSOR [G]

create 
	make

feature -- Access

	cursor_index: INTEGER_32
			-- Index position of cursor in the iteration.

	target_index: INTEGER_32
			-- Index position of target structure for current iteration.

	first_index: INTEGER_32
			-- First valid index of target structure for current iteration.
			-- Note that if is_reversed, first_index might be greater than last_index.

	last_index: INTEGER_32
			-- Last valid index of target structure for current iteration.
			-- Note that if is_reversed, first_index might be greater than last_index.

	step: INTEGER_32
			-- Distance between successive iteration elements.

	new_cursor: like Current
			-- Restarted cursor of the iteration.

	reversed alias "-": like Current
			-- Reversed cursor of the iteration.

	incremented alias "+" (n: like step): like Current
			-- Cursor for the iteration with step increased by n.

	decremented alias "-" (n: like step): like Current
			-- Cursor for the iteration with step decreased by n.

	with_step (n: like step): like Current
			-- Cursor for the iteration with step set to n.
	
feature -- Measurement

	version: NATURAL_32
			-- Current version.
		note
			option: transient
	
feature -- Status report

	after: BOOLEAN
			-- Are there no more items to iterate over?

	is_reversed: BOOLEAN
			-- Are we traversing target structure backwards?

	is_valid: BOOLEAN
			-- Is the cursor still compatible with the associated underlying object?

	is_first: BOOLEAN
			-- Is cursor at first position?

	is_last: BOOLEAN
			-- Is cursor at last position?
	
feature -- Status setting

	reverse
			-- Flip traversal order.
		ensure
			is_reversed: is_reversed = not old is_reversed

	set_step (v: like step)
			-- Set increment step to v.
		require
			v_positive: v > 0
		ensure
			step_set: step = v
	
feature -- Cursor movement

	start
			-- Move to first position.

	forth
			-- Move to next position.
		ensure then
			cursor_index_advanced: cursor_index = old cursor_index + 1
	
note
	copyright: "Copyright (c) 1984-2017, 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 READABLE_INDEXABLE_ITERATION_CURSOR

Generated by ISE EiffelStudio