|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y25.base.LayeredGraph.IDAssigner
A GraphListener
that is responsible for assigning new and
unique IDs to newly created nodes and edges in graphs that belong to this
LayeredGraph
.
Constructor Summary | |
protected |
LayeredGraph.IDAssigner()
|
Method Summary | |
void |
onGraphEvent(GraphEvent evt)
This method is responsible for assigning new and unique IDs to nodes and edges whenever they are created and to remove IDs of nodes and edges whenever they are deleted from a graph. |
void |
removeEdgeID(Edge edge)
Removes the edge ID of the passed edge from the set of used IDs. |
void |
removeIDs(Graph graph)
Removes IDs of nodes and edges that occur in the passed graph from the set of used IDs. |
void |
removeNodeID(Node node)
Removes the node ID of the passed node from the set of used IDs. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected LayeredGraph.IDAssigner()
Method Detail |
public void onGraphEvent(GraphEvent evt)
Special care is taken if a node or edge is removed that has an ID that is still assigned to some other node or edge. In this case, the ID is not removed from the set of used IDs.
If a node ID is removed, all other nodes that have that ID as their
parent ID are visited and their parent ID is set to 0
.
onGraphEvent
in interface GraphListener
GraphListener.onGraphEvent(y.base.GraphEvent)
public void removeIDs(Graph graph)
removeNodeID
and
removeEdgeID
for every node and every edge in the
passed graph. For details, consult the documentation of those
methods.
It is irrelevant if the passed graph is still part of the LayeredGraph or if it has already been removed. It is only important that is still has all the structure information (node/parent/edge IDs).
graph
- The graph that holds the nodes and edges whose IDs will be
removed.public void removeEdgeID(Edge edge)
It is irrelevant if the passed edge is still part of the LayeredGraph or if it is already removed (together with its parent graph). It is only necessary that the edges parent graph still has structure information (node/parent/edge IDs).
edge
- The edge whose ID will be removed.public void removeNodeID(Node node)
If the node ID is removed, all other nodes that have this ID as their
parent ID will be visited and their parent ID will be set to
0
.
It is irrelevant if the passed node is still part of the LayeredGraph or if it is already removed (together with its parent graph). It is only necessary that the nodes parent graph still has structure information (node/parent/edge IDs).
node
- The node whose ID should be removed.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |