|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
MutableCEDigraph adds mutators to the CEDigraph interface so that a developer can add and remove edges and nodes.
Implementations should provide three constructors: a constructor with no arguments that creates a reasonably small CEDigraph, a constructor that supplies arguments for the initial number of nodes and edges as appropriate, and a copy constructor that has a single CEDigraph as a parameter. This last constructor should copy the digraph into itself.
Field Summary |
Fields inherited from interface net.walend.digraph.CEDigraph |
EMPTY |
Method Summary | |
java.lang.Object |
addEdge(java.lang.Object fromNode,
java.lang.Object toNode,
java.lang.Object edge)
Return null if no existing edge is displaced by edge. |
boolean |
addNode(java.lang.Object node)
Return true if the node is added successfully, false if the digraph does not change. |
boolean |
addNodes(java.util.Set nodes)
Return true if adding the nodes changes the digraph. |
void |
clear()
Remove all nodes and edges from the CEDigraph |
void |
clearEdges()
Remove all the edges from the CEDigraph. |
Bag |
removeCEDigraph(CEDigraph digraph)
Return a Bag of edges orphaned when digraph is removed |
java.lang.Object |
removeEdge(java.lang.Object fromNode,
java.lang.Object toNode)
Return the edge that connected fromNode to toNode, or null if no edge existed. |
Bag |
removeNode(java.lang.Object node)
Return the Bag of orphaned edges that are removed with node |
Bag |
removeNodes(java.util.Set nodes)
Return the Bag of edges orphaned edges when these nodes are removed. |
Bag |
retainNodes(java.util.Set nodes)
Return a Bag of orphaned edges when the nodes are removed. |
Methods inherited from interface net.walend.digraph.CEDigraph |
containsCEDigraph, containsEdge, edgeIterator, getEdge, getEdges, getInboundEdges, getOutboundEdges, intersectWithCEDigraph, sameCEDigraphAs, unionCEDigraph |
Methods inherited from interface net.walend.digraph.Digraph |
containsEdge, containsNode, containsNodes, countInboundEdges, countOutboundEdges, edgeCount, edgeNodeIterator, getFromNodes, getNodes, getToNodes, isEdgeFree, isEmpty, nodeCount, nodeIterator |
Methods inherited from interface net.walend.collection.HasState |
getPrincipleInterface, sameStateAs |
Method Detail |
public boolean addNode(java.lang.Object node)
public java.lang.Object addEdge(java.lang.Object fromNode, java.lang.Object toNode, java.lang.Object edge) throws NodeMissingException
NodeMissingException
- if either node is not in the digraph.public Bag removeNode(java.lang.Object node) throws NodeMissingException
NodeMissingException
- if the node is not in the digraphpublic java.lang.Object removeEdge(java.lang.Object fromNode, java.lang.Object toNode) throws NodeMissingException
NodeMissingException
- if either node is not in the digraphpublic boolean addNodes(java.util.Set nodes)
public Bag removeNodes(java.util.Set nodes)
public Bag removeCEDigraph(CEDigraph digraph)
public Bag retainNodes(java.util.Set nodes)
public void clear()
public void clearEdges()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |