maspack.graph
Class DirectedGraph<A,B>

java.lang.Object
  extended by maspack.graph.DirectedGraph<A,B>
Direct Known Subclasses:
Graph

public class DirectedGraph<A,B>
extends java.lang.Object


Constructor Summary
DirectedGraph()
           
 
Method Summary
 boolean addEdge(DirectedEdge<A,B> edge)
           
 void clear()
           
<C,D> DirectedGraph<C,D>
cloneStructure()
           
static
<A,B,C,D> DirectedGraph<C,D>
cloneStructure(DirectedGraph<A,B> orig)
           
 DirectedEdge<A,B> connect(A object1, A object2, B objEdge, double cost)
           
 DirectedEdge<A,B> connect(Vertex<A,B> vtx1, Vertex<A,B> vtx2, B objEdge, double cost)
           
 int disconnect(Vertex<A,B> vtx1, Vertex<A,B> vtx2)
           
static
<A,B,C,D> DirectedGraph<C,D>
exchangeData(DirectedGraph<A,B> graph, java.util.HashMap<A,C> vtxMap, java.util.HashMap<B,D> edgeMap)
           
<C,D> DirectedGraph<C,D>
exchangeData(java.util.HashMap<A,C> vtxMap, java.util.HashMap<B,D> edgeMap)
           
static
<A,B,D> DirectedGraph<A,D>
exchangeEdgeData(DirectedGraph<A,B> graph, java.util.HashMap<A,D> edgeMap)
           
<D> DirectedGraph<A,D>
exchangeEdgeData(java.util.HashMap<A,D> edgeMap)
           
static
<A,B,C> DirectedGraph<C,B>
exchangeVertexData(DirectedGraph<A,B> graph, java.util.HashMap<A,C> vtxMap)
           
<C> DirectedGraph<C,B>
exchangeVertexData(java.util.HashMap<A,C> vtxMap)
           
 DirectedEdge<A,B> findEdge(A obj1, A obj2)
           
 DirectedEdge<A,B> findEdge(Vertex<A,B> vtx1, Vertex<A,B> vtx2)
           
 java.util.ArrayList<Vertex<A,B>> findEndNodes()
           
 java.util.ArrayList<Vertex<A,B>> findStartNodes()
           
 Vertex<A,B> findVertex(A obj)
           
 DirectedEdge<A,B> getDirectedEdge(int idx)
           
 int getDirectedEdgeIndex(DirectedEdge<A,B> edge)
           
 java.util.ArrayList<DirectedEdge<A,B>> getEdges()
           
 Vertex<A,B> getVertex(int idx)
           
 int getVertexIndex(Vertex<A,B> vtx)
           
 java.util.ArrayList<Vertex<A,B>> getVertices()
           
 int numDirectedEdges()
           
 int numVertices()
           
 boolean removeEdge(DirectedEdge<A,B> edge)
           
 boolean removeVertex(Vertex<A,B> vtx)
           
 Path<A,B> shortestPath(A start, A end)
           
 Path<A,B> shortestPath(A start, java.util.List<A> endList)
           
 Path<A,B> shortestPath(Vertex<A,B> vtxStart, java.util.ArrayList<Vertex<A,B>> vtxEnd)
           
 Path<A,B> shortestPath(Vertex<A,B> vtxStart, Vertex<A,B> vtxEnd)
           
 Vertex<A,B> traverseEdgesBackward(Vertex<A,B> start, B[] edgeData)
           
 Vertex<A,B> traverseEdgesForward(Vertex<A,B> start, B[] edgeData)
           
 Vertex<A,B> traverseVerticesBackward(Vertex<A,B> start, A[] vtxData)
           
 Vertex<A,B> traverseVerticesForward(Vertex<A,B> start, A[] vtxData)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectedGraph

public DirectedGraph()
Method Detail

disconnect

public int disconnect(Vertex<A,B> vtx1,
                      Vertex<A,B> vtx2)

removeVertex

public boolean removeVertex(Vertex<A,B> vtx)

removeEdge

public boolean removeEdge(DirectedEdge<A,B> edge)

addEdge

public boolean addEdge(DirectedEdge<A,B> edge)

connect

public DirectedEdge<A,B> connect(Vertex<A,B> vtx1,
                                 Vertex<A,B> vtx2,
                                 B objEdge,
                                 double cost)

connect

public DirectedEdge<A,B> connect(A object1,
                                 A object2,
                                 B objEdge,
                                 double cost)

findVertex

public Vertex<A,B> findVertex(A obj)

findEdge

public DirectedEdge<A,B> findEdge(Vertex<A,B> vtx1,
                                  Vertex<A,B> vtx2)

traverseEdgesForward

public Vertex<A,B> traverseEdgesForward(Vertex<A,B> start,
                                        B[] edgeData)

traverseEdgesBackward

public Vertex<A,B> traverseEdgesBackward(Vertex<A,B> start,
                                         B[] edgeData)

traverseVerticesForward

public Vertex<A,B> traverseVerticesForward(Vertex<A,B> start,
                                           A[] vtxData)

traverseVerticesBackward

public Vertex<A,B> traverseVerticesBackward(Vertex<A,B> start,
                                            A[] vtxData)

findEdge

public DirectedEdge<A,B> findEdge(A obj1,
                                  A obj2)

shortestPath

public Path<A,B> shortestPath(Vertex<A,B> vtxStart,
                              Vertex<A,B> vtxEnd)

shortestPath

public Path<A,B> shortestPath(Vertex<A,B> vtxStart,
                              java.util.ArrayList<Vertex<A,B>> vtxEnd)

shortestPath

public Path<A,B> shortestPath(A start,
                              java.util.List<A> endList)

shortestPath

public Path<A,B> shortestPath(A start,
                              A end)

getEdges

public java.util.ArrayList<DirectedEdge<A,B>> getEdges()

getVertices

public java.util.ArrayList<Vertex<A,B>> getVertices()

getVertex

public Vertex<A,B> getVertex(int idx)

getDirectedEdge

public DirectedEdge<A,B> getDirectedEdge(int idx)

clear

public void clear()

findStartNodes

public java.util.ArrayList<Vertex<A,B>> findStartNodes()

findEndNodes

public java.util.ArrayList<Vertex<A,B>> findEndNodes()

numVertices

public int numVertices()

numDirectedEdges

public int numDirectedEdges()

getVertexIndex

public int getVertexIndex(Vertex<A,B> vtx)

getDirectedEdgeIndex

public int getDirectedEdgeIndex(DirectedEdge<A,B> edge)

exchangeData

public <C,D> DirectedGraph<C,D> exchangeData(java.util.HashMap<A,C> vtxMap,
                                             java.util.HashMap<B,D> edgeMap)

exchangeVertexData

public <C> DirectedGraph<C,B> exchangeVertexData(java.util.HashMap<A,C> vtxMap)

exchangeEdgeData

public <D> DirectedGraph<A,D> exchangeEdgeData(java.util.HashMap<A,D> edgeMap)

exchangeData

public static <A,B,C,D> DirectedGraph<C,D> exchangeData(DirectedGraph<A,B> graph,
                                                        java.util.HashMap<A,C> vtxMap,
                                                        java.util.HashMap<B,D> edgeMap)

exchangeVertexData

public static <A,B,C> DirectedGraph<C,B> exchangeVertexData(DirectedGraph<A,B> graph,
                                                            java.util.HashMap<A,C> vtxMap)

exchangeEdgeData

public static <A,B,D> DirectedGraph<A,D> exchangeEdgeData(DirectedGraph<A,B> graph,
                                                          java.util.HashMap<A,D> edgeMap)

cloneStructure

public static <A,B,C,D> DirectedGraph<C,D> cloneStructure(DirectedGraph<A,B> orig)

cloneStructure

public <C,D> DirectedGraph<C,D> cloneStructure()