7.4.10. Iterator Classes

Some elements of the RFG can be iterated (e. g. by using for loops): The views of a graph, the nodes of a view, and the contents of node sets as well as the contents of edge sets.

7.4.10.1. Classes GraphViewIter, GraphNodeIter, and GraphEdgeIter

__init__(the_graph)
__iter__()
next()
__del__()

These methods constitute the standard interface for iterator objects. The iterator is frequently used in for loops. A call to next returns the next view of the graph the iterator is iterating as a View object.

7.4.10.2. Classes ViewNodeIter and ViewEdgeIter

__init__(the_view)
__iter__()
next()
__del__()

These methods constitute the standard interface for iterator objects. The iterator is frequently used in for loops. A call to next returns the next node of the view the iterator is iterating as a Node object.

7.4.10.3. Class NodeSetIter and EdgeSetIter

__init__(the_set)
__iter__()
next()
__del__()

These methods constitute the standard interface for iterator objects. The iterator is frequently used in for loops.

If a node set is iterated, a call to next returns the next node of the set as a Node object. If an edge set is iterated, a call to next returns the next edge of the set as an Edge object.