EiffelBase class
(HTML page generated by ISE Eiffel 4.2)
Eiffel Class
indexing
description: "Cursors for linked lists";
status: "See notice at end of class";
names: linked_list_cursor, cursor;
contents: generic;
date: "$Date: 2007-03-30 11:10:11 -0800 (Fri, 30 Mar 2007) $";
revision: "$Revision: 95354 $"
class LINKED_LIST_CURSOR [G]
inherit
CURSOR
creation
make
feature {LINKED_LIST} -- Initialization
make (active_element: like active; aft, bef: BOOLEAN) is
-- Create a cursor and set it up on active_element.
do
active := active_element;
after := aft;
before := bef
end;
feature {LINKED_LIST} -- Implementation
active: LINKABLE [G];
-- Current element in linked list
after: BOOLEAN;
-- Is there no valid cursor position to the right of cursor?
before: BOOLEAN;
-- Is there no valid cursor position to the right of cursor?
invariant
not_both: not(before and after);
no_active_not_on: active = void implies (before or after);
end -- class LINKED_LIST_CURSOR
|