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: "Infinite sequences, indexed by integers";
	status: "See notice at end of class";
	names: countable_sequence, infinite_sequence;
	access: cursor, membership;
	contents: generic;
	date: "$Date: 2007-03-30 11:10:11 -0800 (Fri, 30 Mar 2007) $";
	revision: "$Revision: 95354 $"

deferred class COUNTABLE_SEQUENCE [G]

inherit
	COUNTABLE [G]
		rename
			item as i_th
		end;
	ACTIVE [G]
		export
			{NONE} fill, prune_all, put, prune, wipe_out, replace, remove
		end;
	LINEAR [G]
		redefine
			linear_representation
		end

feature -- Access

	i_th (i: INTEGER): G is
			-- Item of rank i
		deferred
		end;

	index: INTEGER;
			-- Index of current position

	item: G is
			-- Item at current position
		do
			Result := i_th (index)
		end;

feature -- Status report

	After: BOOLEAN is false;
			-- Is current position past last item? (Answer: no.)

	Extendible: BOOLEAN is false;
			-- May items be added? (Answer: no.)

	Prunable: BOOLEAN is false;
			-- May items be removed? (Answer: no.)

	Readable: BOOLEAN is true;
			-- Is there a current item that may be read?
			-- (Answer: yes.)

	Writable: BOOLEAN is false;
			-- Is there a current item that may be written?
			-- (Answer: no.)

feature -- Cursor movement

	forth is
			-- Move to next position.
		do
			index := index + 1
		end;

	start is
			-- Move to first position.
		do
			index := 1
		end;

feature {NONE} -- Inapplicable

	extend (v: G) is
			-- Add v at end.
		do
		end;

	finish is
			-- Move to last position.
		do
		ensure
			failure: false
		end;

	linear_representation: LINEAR [G] is
			-- Representation as a linear structure
		do
		end;

	prune (v: G) is
			-- Remove first occurrence of v, if any.
		do
		end;

	put (v: G) is
			-- Add v to the right of current position.
		do
		end;

	remove is
			-- Remove item to the right of current position.
		do
		end;

	replace (v: G) is
			-- Replace by v item at current position.
		do
		end;

	wipe_out is
			-- Remove all items.
		do
		end;

end -- class COUNTABLE_SEQUENCE