Interface GraphVisitor<G extends Graph<G,​N,​E>,​N extends Node<G,​N,​E>,​E extends Edge<G,​N,​E>,​V>

  • Type Parameters:
    G - the type of Graph that this visitor visits
    N - the type of Nodes in the visited graph
    E - the type of Edges in the visited graph
    V - the type of auxiliary tool that the callbacks provided by this visitor can use while visiting the graph
    All Known Subinterfaces:
    Check<T>, SemanticCheck<A>, SyntacticCheck

    public interface GraphVisitor<G extends Graph<G,​N,​E>,​N extends Node<G,​N,​E>,​E extends Edge<G,​N,​E>,​V>
    A visitor of a Graph. Instances of this interface provide callbacks to invoke when visiting the various components of a graph.

    The visiting starts by visiting the graph itself through visit(Object, Graph), and then by visiting Nodes and Edges independently, in no particular order, through visit(Object, Graph, Node) and visit(Object, Graph, Edge) respectively.
    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default boolean visit​(V tool, G graph)
      Visits a graph, inspecting its structure and signature, but without accessing its contents.
      default boolean visit​(V tool, G graph, E edge)
      Visits an edge of the given graph.
      default boolean visit​(V tool, G graph, N node)
      Visits a node of the given graph.
      default boolean visitSubNodesFirst()
      Yields whether or not, when visiting a compound node through visit(Object, Graph, Node), its sub-nodes should be visited before the node itself.
    • Method Detail

      • visit

        default boolean visit​(V tool,
                              G graph)
        Visits a graph, inspecting its structure and signature, but without accessing its contents. The default implementation does nothing and returns true.
        Parameters:
        tool - the auxiliary tool that this visitor can use
        graph - the graph being visited
        Returns:
        whether or not the visiting should continue when this call returns. If this method returns false, the visiting will be interrupted
      • visit

        default boolean visit​(V tool,
                              G graph,
                              N node)
        Visits a node of the given graph. The default implementation does nothing and returns true.
        Parameters:
        tool - the auxiliary tool that this visitor can use
        graph - the graph where the visited node belongs
        node - the node being visited
        Returns:
        whether or not the visiting should continue when this call returns. If this method returns false, the visiting will be interrupted
      • visit

        default boolean visit​(V tool,
                              G graph,
                              E edge)
        Visits an edge of the given graph. The default implementation does nothing and returns true.
        Parameters:
        tool - the auxiliary tool that this visitor can use
        graph - the graph where the visited edge belongs
        edge - the edge being visited
        Returns:
        whether or not the visiting should continue when this call returns. If this method returns false, the visiting will be interrupted
      • visitSubNodesFirst

        default boolean visitSubNodesFirst()
        Yields whether or not, when visiting a compound node through visit(Object, Graph, Node), its sub-nodes should be visited before the node itself.
        Returns:
        true if that condition holds