GraphIterator

Inherits: Reference < Object

A class used as a base for implementing custom iterators to traverse a Graph.

Description

The class allows for fine-grained control over graph traversal. The instance of the class can be used individually, or set as a custom iterator for Graph via Graph.iterator.

Methods

bool has_next ( ) virtual
void initialize ( Object root ) virtual
Object next ( ) virtual

Method Descriptions

  • bool has_next ( ) virtual

Must return true if there exist an element available for next iteration. For example: return next_vertex != null.


  • void initialize ( Object root ) virtual

Must initialize a root node from which an iterator starts to traverse the graph.


Must return the next vertex. For the first iteration, all built-in iterators in Graph return the root node by convention.