class GBN_IEDGE_ITERATOR -- produces edgges of an indexed graph -- if undirected, the first copy of each -- edge is produced, not the second. inherit GBN_ITERATOR [ GBN_IEDGE ] creation {GBN_IGRAPH} make feature {NONE} make ( container: like source ) is require nonvoid: container /= Void do source := container cursor := 1 if not finished then container . logon end ensure valid_source: source = container protection: finished or else source . is_protected end feature { GBN_IGRAPH } source : GBN_IGRAPH feature {ANY} finished: BOOLEAN is do Result := not cursor.in_range ( 1, source.the_edges.count ) end forth is do cursor := cursor + 1 if source . is_undirected then from until finished or else source . the_inverses . item (cursor) > cursor loop cursor := cursor + 1 end end if finished then source.logoff end end stop is do cursor := source.the_edges.count + 1 source . logoff end item : GBN_IEDGE is do Result := source . the_edges . item ( cursor ) end feature {NONE} cursor : INTEGER end -- class GBN_IEDGE_ITERATOR