net.walend.digraph
Interface Digraph

All Superinterfaces:
HasState
All Known Subinterfaces:
CEDigraph, CEPath, DigraphOfCEPaths, DigraphOfGEPaths, GEDigraph, GEPath, IndexedCEDigraph, IndexedDigraph, IndexedGEDigraph, IndexedMutableCEDigraph, IndexedMutableGEDigraph, MeasuredCEPath, MeasuredGEPath, MutableCEDigraph, MutableCEPath, MutableDigraphOfCEPaths, MutableDigraphOfGEPaths, MutableGEDigraph, MutableGEPath, MutableUEDigraph, MutableUEPath, Path, ShortestCEPaths, ShortestGEPaths, UEDigraph, UEPath
All Known Implementing Classes:
AbstractDelegateDigraphOfCEPaths, AbstractDelegateDigraphOfCEPaths.DigraphCEPath, AbstractDelegateDigraphOfGEPaths, AbstractDelegateDigraphOfGEPaths.DigraphGEPath, AbstractHashCEDigraph, AbstractHashGEDigraph, AbstractHashUEDigraph, AbstractListCEPath, AbstractListGEPath, AbstractListUEPath, AbstractMatrixCEDigraph, AbstractMatrixGEDigraph, AbstractMatrixUEDigraph, AbstractShortestCEPaths, AbstractShortestCEPaths.DigraphMeasuredCEPath, AbstractShortestGEPaths, AbstractShortestGEPaths.DigraphMeasuredGEPath, CEBellmanFordTest, CEBellmanFordTest.BFCEDigraph, CEPathsFromShortestDistances, CEPathsFromShortestDistances.DigraphMeasuredCEPath, DijkstraShortestCEPaths, DijkstraShortestGEPaths, FloydWarshallShortestCEPaths, FloydWarshallShortestGEPaths, GEBellmanFordTest, GEBellmanFordTest.BFGEDigraph, JITShortestCEPaths, JITShortestGEPaths, JohnsonShortestCEPaths, JohnsonShortestGEPaths, MutableHashCEDigraph, MutableHashGEDigraph, MutableHashUEDigraph, MutableListCEPath, MutableListGEPath, MutableListUEPath, MutableLMCEDigraph, MutableLMGEDigraph, MutableMatrixCEDigraph, MutableMatrixGEDigraph, MutableMatrixUEDigraph

public interface Digraph
extends HasState

Digraph is a superinterface for representing directed graphs. Nothing should implement it directly, because it won't define the rules well enough.

Author:
David Walend dfw1@cornell.edu

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

nodeCount

public int nodeCount()

edgeCount

public int edgeCount()

isEmpty

public boolean isEmpty()

containsNode

public boolean containsNode(java.lang.Object node)

containsEdge

public boolean containsEdge(java.lang.Object fromNode,
                            java.lang.Object toNode)
                     throws NodeMissingException
Returns true if the digraph contains any edge from fromNode to toNode

Throws:
NodeMissingException - if either node is missing from the digraph.

countInboundEdges

public int countInboundEdges(java.lang.Object node)
                      throws NodeMissingException
Throws:
NodeMissingException - if node is not in the digraph.

countOutboundEdges

public int countOutboundEdges(java.lang.Object node)
                       throws NodeMissingException
Throws:
NodeMissingException - if node is not in the digraph.

getFromNodes

public java.util.Set getFromNodes(java.lang.Object node)
                           throws NodeMissingException
Returns the set of nodes that can reach this node by crossing one edge.

Throws:
NodeMissingException - if node is not in the digraph.

getToNodes

public java.util.Set getToNodes(java.lang.Object node)
                         throws NodeMissingException
Returns the set of nodes that can be reached from this node by crossing one edge.

Throws:
NodeMissingException - if node is not in the digraph.

nodeIterator

public java.util.Iterator nodeIterator()
Implementations should explicitly state how they interpret nodeIterator()'s remove method. It should either throw an UnsupportedOperationException or cause a hidden side effects of removing edges.


edgeNodeIterator

public EdgeNodeIterator edgeNodeIterator()
Returns an iterator that iterates across pairs of nodes that make edges.


getNodes

public java.util.Set getNodes()

isEdgeFree

public boolean isEdgeFree()
Returns true if this Digraph has no edges.


containsNodes

public boolean containsNodes(java.util.Set nodes)


Copyright (c) 2001, 2002, David Walend