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: "Structures that may be traversed forward and backward";
	status: "See notice at end of class";
	names: bidirectional, traversing;
	access: cursor, membership;
	contents: generic;
	date: "$Date: 2007-03-30 11:10:11 -0800 (Fri, 30 Mar 2007) $";
	revision: "$Revision: 95354 $"

deferred class BILINEAR [G]

inherit
	LINEAR [G]
		rename
			search as sequential_search
		export
			{NONE} sequential_search
		redefine
			off
		end;
	LINEAR [G]
		redefine
			search, off
		select
			search
		end

feature -- Access

	off: BOOLEAN is
			-- Is there no current item?
		do
			Result := before or after
		end;

feature -- Cursor movement

	before: BOOLEAN is
			-- Is there no valid position to the left of current one?
		deferred
		end;

	back is
			-- Move to previous position.
		require
			not_before: notbefore
		deferred
		ensure
			moved_back: index = old index - 1
		end;

	search (v: like item) is
			-- Move to first position (at or after current
			-- position) where item and v are equal.
			-- If structure does not include v ensure that
			-- exhausted will be true.
			-- (Reference or object equality,
			-- based on object_comparison.)
		do
			if before and notempty then
				forth
			end;
			sequential_search (v)
		end;

invariant

	not_both: not(after and before);
	empty_property: empty implies (after or before);
	before_constraint: before implies off;

end -- class BILINEAR