|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Digraph is a superinterface for representing directed graphs. Nothing should implement it directly, because it won't define the rules well enough.
Method Summary | |
boolean |
containsEdge(java.lang.Object fromNode,
java.lang.Object toNode)
Returns true if the digraph contains any edge from fromNode to toNode |
boolean |
containsNode(java.lang.Object node)
|
boolean |
containsNodes(java.util.Set nodes)
|
int |
countInboundEdges(java.lang.Object node)
|
int |
countOutboundEdges(java.lang.Object node)
|
int |
edgeCount()
|
EdgeNodeIterator |
edgeNodeIterator()
Returns an iterator that iterates across pairs of nodes that make edges. |
java.util.Set |
getFromNodes(java.lang.Object node)
Returns the set of nodes that can reach this node by crossing one edge. |
java.util.Set |
getNodes()
|
java.util.Set |
getToNodes(java.lang.Object node)
Returns the set of nodes that can be reached from this node by crossing one edge. |
boolean |
isEdgeFree()
Returns true if this Digraph has no edges. |
boolean |
isEmpty()
|
int |
nodeCount()
|
java.util.Iterator |
nodeIterator()
Implementations should explicitly state how they interpret nodeIterator()'s remove method. |
Methods inherited from interface net.walend.collection.HasState |
getPrincipleInterface, sameStateAs |
Method Detail |
public int nodeCount()
public int edgeCount()
public boolean isEmpty()
public boolean containsNode(java.lang.Object node)
public boolean containsEdge(java.lang.Object fromNode, java.lang.Object toNode) throws NodeMissingException
NodeMissingException
- if either node is missing from the digraph.public int countInboundEdges(java.lang.Object node) throws NodeMissingException
NodeMissingException
- if node is not in the digraph.public int countOutboundEdges(java.lang.Object node) throws NodeMissingException
NodeMissingException
- if node is not in the digraph.public java.util.Set getFromNodes(java.lang.Object node) throws NodeMissingException
NodeMissingException
- if node is not in the digraph.public java.util.Set getToNodes(java.lang.Object node) throws NodeMissingException
NodeMissingException
- if node is not in the digraph.public java.util.Iterator nodeIterator()
public EdgeNodeIterator edgeNodeIterator()
public java.util.Set getNodes()
public boolean isEdgeFree()
public boolean containsNodes(java.util.Set nodes)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |