de.grogra.graph
| Modifier and Type | Field and Description |
|---|---|
protected EdgePattern |
pattern |
protected GraphState |
state |
| Constructor and Description |
|---|
VisitorImpl() |
| Modifier and Type | Method and Description |
|---|---|
GraphState |
getGraphState()
Returns the graph state within which the visitor is operating.
|
void |
init(GraphState gs,
EdgePattern pattern) |
java.lang.Object |
visitEnter(Path path,
boolean node)
Informs this visitor about a node or edge in the graph.
|
java.lang.Object |
visitInstanceEnter()
Informs this visitor about the beginning of an instantiation.
|
boolean |
visitInstanceLeave(java.lang.Object o)
Informs this visitor that an instantiation has been processed
completely.
|
boolean |
visitLeave(java.lang.Object o,
Path path,
boolean node)
Informs this visitor that a node or an edge has been processed
completely.
|
protected EdgePattern pattern
protected GraphState state
public GraphState getGraphState()
VisitorgetGraphState in interface Visitorpublic void init(GraphState gs, EdgePattern pattern)
public java.lang.Object visitEnter(Path path, boolean node)
Visitorpath contains the path from the root up to and including
the node or, in case an edge is visited, the edge and its terminal node. Later on,
Visitor.visitLeave(java.lang.Object, de.grogra.graph.Path, boolean) will be invoked with
the returned value of this invocation, path
and node as arguments. If this method returns
Visitor.STOP, the corresponding visitLeave-method
will be invoked immediately after this method, i.e., the visitor
does not dive more deeply in the hierarchy. Otherwise, if a
node is visited and there
are instantiations associated with or edges connected with
it (regardless of their direction), their corresponding visitor methods will be invoked
inbetween. Likewise, if an edge is visited, its indicent terminal node
will be visited next.visitEnter in interface Visitorpath - current pathnode - do we enter a node or an edge?visitLeave, may be Visitor.STOPpublic java.lang.Object visitInstanceEnter()
VisitorvisitEnter/visitLeave of a node. Later on,
Visitor.visitInstanceLeave(Object) will be invoked with
the returned value of this invocation as argument. If this method returns
Visitor.STOP, the visitInstanceLeave-method
will be invoked immediately after this method, i.e., the visitor
does not dive into the instantiation. Otherwise, the instantiation
is performed, starting with an edge.visitInstanceEnter in interface VisitorvisitInstanceLeave, may be Visitor.STOPpublic boolean visitInstanceLeave(java.lang.Object o)
Visitoro is the return value
of the corresponding invocation of Visitor.visitInstanceEnter().
If this invocation returns false, no further
instantiations or edges of the current level of hierarchy will
be passed to this
visitor, i.e., the visitLeave method for the enclosing
node will be invoked immediately.visitInstanceLeave in interface Visitoro - returned value of visitInstanceEntertrue iff processing of current level shall be continuedpublic boolean visitLeave(java.lang.Object o,
Path path,
boolean node)
Visitoro is the return value
of the corresponding invocation of Visitor.visitEnter(de.grogra.graph.Path, boolean).
In case of a node and if this invocation returns false, no further
edges of the current level of hierarchy will be passed to this
visitor, i.e., the visitLeave methods for the enclosing
edge and node will be invoked immediately.
Likewise, in case of an edge and a return value false, no further
instantiations or edges of the current level of hierarchy
will be passed to this
visitor, i.e., the visitLeave method for the enclosing
node will be invoked immediately.visitLeave in interface Visitoro - returned value of visitEnterpath - current path to nodenode - do we leave a node or an edge?true iff processing of current level shall be continued