public class TreeListener extends NullGraphListener
| Constructor and Description |
|---|
TreeListener(Tree tree)
Creates a new TreeListener for the given Tree.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterVertexAdded(GraphAddVertexEvent event)
Called when a vertex is being added to a graph, just after the graph
structure has actually been changed.
|
void |
afterVertexRemoved(GraphRemoveVertexEvent event)
Called when a vertex is being removed from a graph, just after the
graph structure has actually been changed.
|
void |
beforeEdgeAdded(GraphAddEdgeEvent event)
Called when an edge is being added to a graph, just before the graph
structure is actually changed.
|
void |
beforeEdgeRemoved(GraphRemoveEdgeEvent event)
Called when an edge is being removed from a graph, just before the
graph structure is actually changed.
|
void |
beforeVertexAdded(GraphAddVertexEvent event)
Called when a vertex is being added to a graph, just before the graph
structure is actually changed.
|
void |
beforeVertexRemoved(GraphRemoveVertexEvent event)
Called when a vertex is being removed from a graph, just before the
graph structure is actually changed.
|
List |
getChildren(Vertex vertex) |
int |
getDepth(Vertex node) |
int |
getHeight() |
List |
getLeaves() |
Vertex |
getParent(Vertex vertex) |
Vertex |
getRoot() |
Tree |
getSubTree(Vertex subTreeRootVertex) |
boolean |
isLeaf(Vertex vertex) |
void |
setRoot(Vertex rootVertex) |
afterEdgeAdded, afterEdgeRemovedpublic TreeListener(Tree tree)
tree - the graph to which this listener is to be attached;
this constructor will automatically register the listener
to receive all eventspublic void beforeVertexAdded(GraphAddVertexEvent event) throws Exception
GraphListenerbeforeVertexAdded in interface GraphListenerbeforeVertexAdded in class NullGraphListenerevent - the event describing the vertex additionExceptionpublic void afterVertexAdded(GraphAddVertexEvent event)
GraphListenerafterVertexAdded in interface GraphListenerafterVertexAdded in class NullGraphListenerevent - the event describing the vertex additionpublic void beforeVertexRemoved(GraphRemoveVertexEvent event) throws Exception
GraphListenerbeforeVertexRemoved in interface GraphListenerbeforeVertexRemoved in class NullGraphListenerevent - the event describing the vertex removalExceptionpublic void afterVertexRemoved(GraphRemoveVertexEvent event)
GraphListenerafterVertexRemoved in interface GraphListenerafterVertexRemoved in class NullGraphListenerevent - the event describing the vertex removalpublic void beforeEdgeAdded(GraphAddEdgeEvent event) throws Exception
GraphListenerbeforeEdgeAdded in interface GraphListenerbeforeEdgeAdded in class NullGraphListenerevent - the event describing the edge additionExceptionpublic void beforeEdgeRemoved(GraphRemoveEdgeEvent event) throws Exception
GraphListenerbeforeEdgeRemoved in interface GraphListenerbeforeEdgeRemoved in class NullGraphListenerevent - the event describing the edge removalExceptionpublic void setRoot(Vertex rootVertex) throws GraphException
GraphExceptionTree.setRoot(salvo.jesus.graph.Vertex)public Vertex getRoot()
Tree.getRoot()public boolean isLeaf(Vertex vertex) throws GraphException
GraphExceptionTree.isLeaf(salvo.jesus.graph.Vertex)public Vertex getParent(Vertex vertex) throws GraphException
GraphExceptionTree.getParent(salvo.jesus.graph.Vertex)public List getChildren(Vertex vertex) throws GraphException
GraphExceptionTree.getChildren(salvo.jesus.graph.Vertex)public Tree getSubTree(Vertex subTreeRootVertex) throws Exception
ExceptionTree.getSubTree(salvo.jesus.graph.Vertex)public int getDepth(Vertex node) throws GraphException
GraphExceptionTree.getDepth(salvo.jesus.graph.Vertex)public List getLeaves()
Tree.getLeaves()public int getHeight()
Tree.getHeight()Copyright © 2019 JULIE Lab, Germany. All rights reserved.