This site contains older material on Eiffel. For the main Eiffel page, see http://www.eiffel.com.

EiffelBase class
(HTML page generated by ISE Eiffel 4.2)

Eiffel Class
indexing
	description: "Dynamically modifiable circular chains";
	status: "See notice at end of class";
	names: dynamic_circular, ring, sequence;
	access: index, cursor, membership;
	contents: generic;
	date: "$Date: 2007-03-30 11:10:11 -0800 (Fri, 30 Mar 2007) $";
	revision: "$Revision: 95354 $"

deferred class DYNAMIC_CIRCULAR [G]

inherit
	CIRCULAR [G]
		undefine
			prune, prune_all
		end;
	DYNAMIC_CHAIN [G]
		undefine
			valid_cursor_index, search, first, last, finish, start, move, go_i_th, off, exhausted
		redefine
			duplicate
		end

feature -- Duplication

	duplicate (n: INTEGER): like Current is
			-- Copy of sub-chain beginning at current position
			-- and having min (n, count) items.
		local
			pos: CURSOR;
			to_be_removed, counter: INTEGER
		do
			from
				Result := new_chain;
				pos := cursor;
				to_be_removed := count.min (n)
			until
				counter = to_be_removed
			loop
				Result.extend (item);
				forth;
				counter := counter + 1
			end;
			go_to (pos)
		end;

end -- class DYNAMIC_CIRCULAR