-- Copyright 2003, Trustees of Indiana University -- Please see the license in the file ../LICENSE class ADJ_LIST_EDGE_ITERATOR inherit JITERATOR[BASIC_EDGE] create make_from_adjacency_list_impl feature {NONE} graph : ADJACENCY_LIST v_iter : ADJ_LIST_VERTEX_ITERATOR out_edge_iter : JITERATOR[BASIC_EDGE] source: INTEGER feature {ADJACENCY_LIST} make_from_adjacency_list_impl (g: ADJACENCY_LIST) is do graph := g end feature -- Access start is local go_out : BOOLEAN do v_iter := graph.vertices v_iter.start from until go_out loop if v_iter.off then go_out := true else out_edge_iter := graph.out_edges(v_iter.item) out_edge_iter.start if out_edge_iter.off then v_iter.forth else go_out := true end end end end item: BASIC_EDGE is do Result := out_edge_iter.item end forth is local go_out : BOOLEAN do out_edge_iter.forth if out_edge_iter.off then from until go_out loop v_iter.forth if v_iter.off then go_out := true else out_edge_iter := graph.out_edges(v_iter.item) out_edge_iter.start if not out_edge_iter.off then go_out := true end end end end end off: BOOLEAN is do Result := v_iter.off end end -- ADJ_LIST_OUT_EDGE_ITERATOR