net.walend.digraph
Interface IndexedDigraph

All Superinterfaces:
Digraph, HasState
All Known Subinterfaces:
DigraphOfCEPaths, DigraphOfGEPaths, IndexedCEDigraph, IndexedGEDigraph, IndexedMutableCEDigraph, IndexedMutableGEDigraph, MutableDigraphOfCEPaths, MutableDigraphOfGEPaths, ShortestCEPaths, ShortestGEPaths
All Known Implementing Classes:
AbstractDelegateDigraphOfCEPaths, AbstractDelegateDigraphOfGEPaths, AbstractMatrixCEDigraph, AbstractMatrixGEDigraph, AbstractShortestCEPaths, AbstractShortestGEPaths, CEBellmanFordTest, CEBellmanFordTest.BFCEDigraph, CEPathsFromShortestDistances, DijkstraShortestCEPaths, DijkstraShortestGEPaths, FloydWarshallShortestCEPaths, FloydWarshallShortestGEPaths, GEBellmanFordTest, GEBellmanFordTest.BFGEDigraph, JITShortestCEPaths, JITShortestGEPaths, JohnsonShortestCEPaths, JohnsonShortestGEPaths, MutableLMCEDigraph, MutableLMGEDigraph, MutableMatrixCEDigraph, MutableMatrixGEDigraph

public interface IndexedDigraph
extends Digraph

IndexedDigraph adds index methods to a Digraph. These methods will in general throw an ArrayIndexOutOfBoundsException if there's no node at a given index. If you know the index should be fine, consider catching it and throwing a ConcurrentModificationException.

Author:
David Walend dfw1@cornell.edu

Method Summary
 boolean containsEdge(int fromIndex, int toIndex)
           
 boolean containsNode(int index)
           
 int countInboundEdges(int index)
           
 int countOutboundEdges(int index)
           
 int[] getFromIndices(int index)
           
 java.util.Set getFromNodes(int index)
           
 java.lang.Object getNode(int index)
           
 int getNodeIndex(java.lang.Object node)
           
 int[] getToIndices(int index)
           
 java.util.Set getToNodes(int index)
           
 IndexedEdgeNodeIterator indexedEdgeNodeIterator()
           
 IndexedIterator indexedNodeIterator()
           
 int nodeCapacity()
          Returns the maximum capacity for nodes in this IndexedDigraph.
 int[] nodeIndices()
          Returns an array if ints that show which node indices are being used.
 
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

nodeCapacity

public int nodeCapacity()
Returns the maximum capacity for nodes in this IndexedDigraph.


nodeIndices

public int[] nodeIndices()
Returns an array if ints that show which node indices are being used.


containsNode

public boolean containsNode(int index)
Throws:
java.lang.ArrayIndexOutOfBoundsException - if index does not have a node. Use nodeIndices() or getNodeIndex() to avoid these. In your code, catch ArrayIndexOutOfBoundsException and throw a ConcurrentModificationException if you think that's the problem.

getNode

public java.lang.Object getNode(int index)
Throws:
java.lang.ArrayIndexOutOfBoundsException - if index does not have a node. Use nodeIndices() or getNodeIndex() to avoid these. In your code, catch ArrayIndexOutOfBoundsException and throw a ConcurrentModificationException if you think that's the problem.

getNodeIndex

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

containsEdge

public boolean containsEdge(int fromIndex,
                            int toIndex)
Throws:
java.lang.ArrayIndexOutOfBoundsException - if index does not have a node. Use nodeIndices() or getNodeIndex() to avoid these. In your code, catch ArrayIndexOutOfBoundsException and throw a ConcurrentModificationException if you think that's the problem.

countInboundEdges

public int countInboundEdges(int index)
Throws:
java.lang.ArrayIndexOutOfBoundsException - if index does not have a node. Use nodeIndices() or getNodeIndex() to avoid these. In your code, catch ArrayIndexOutOfBoundsException and throw a ConcurrentModificationException if you think that's the problem.

countOutboundEdges

public int countOutboundEdges(int index)
Throws:
java.lang.ArrayIndexOutOfBoundsException - if index does not have a node. Use nodeIndices() or getNodeIndex() to avoid these. In your code, catch ArrayIndexOutOfBoundsException and throw a ConcurrentModificationException if you think that's the problem.

getFromNodes

public java.util.Set getFromNodes(int index)
Throws:
java.lang.ArrayIndexOutOfBoundsException - if index does not have a node. Use nodeIndices() or getNodeIndex() to avoid these. In your code, catch ArrayIndexOutOfBoundsException and throw a ConcurrentModificationException if you think that's the problem.

getFromIndices

public int[] getFromIndices(int index)

getToNodes

public java.util.Set getToNodes(int index)
Throws:
java.lang.ArrayIndexOutOfBoundsException - if index does not have a node. Use nodeIndices() or getNodeIndex() to avoid these. In your code, catch ArrayIndexOutOfBoundsException and throw a ConcurrentModificationException if you think that's the problem.

getToIndices

public int[] getToIndices(int index)

indexedEdgeNodeIterator

public IndexedEdgeNodeIterator indexedEdgeNodeIterator()

indexedNodeIterator

public IndexedIterator indexedNodeIterator()


Copyright (c) 2001, 2002, David Walend