com.tensegrity.graph.model
Interface GraphVisitor


public interface GraphVisitor

This class is a functional visitor for subgraphs. It can be used via the method Graph.visitSubgraphs(GraphVisitor)

Version:
$Id: GraphVisitor.java,v 1.8 2003/10/06 13:18:17 sr Exp $
Author:
StepanRutz

Field Summary
static int POST_ORDER
          Constant that tells about the order of graph traversal.
static int PRE_ORDER
          Constant that tells about the order of graph traversal.
 
Method Summary
 int getOrder()
          Returns a constant that defines the order of graph traversal.
 void visit(Subgraph subgraph, int level)
          Callback invoked during traversal of graph-hierarchies.
 

Field Detail

PRE_ORDER

public static final int PRE_ORDER
Constant that tells about the order of graph traversal.

See Also:
Constant Field Values

POST_ORDER

public static final int POST_ORDER
Constant that tells about the order of graph traversal.

See Also:
Constant Field Values
Method Detail

getOrder

public int getOrder()
Returns a constant that defines the order of graph traversal. This constant can be either PRE_ORDER, which means that subgraphs are visited after the actual node is visited, or POST_ORDER, which means that subgraphs are visited before the actual node is visited.

Returns:
int the constant that defines the order of graph traversal

visit

public void visit(Subgraph subgraph,
                  int level)
Callback invoked during traversal of graph-hierarchies.

Parameters:
subgraph - the Subgraph that is currently being visited.
level - the depth of the recursion, which is measured from the beginning point of the recursion. This does not necessarily have to be the top-level-graph if the recursion was initiated from an already nested graph.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.